<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:blogger='http://schemas.google.com/blogger/2008' xmlns:georss='http://www.georss.org/georss' xmlns:gd="http://schemas.google.com/g/2005" xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-2893139382062216061</id><updated>2020-08-18T15:55:38.289+08:00</updated><category term="Asp.Net"/><category term="Excel VBA"/><category term="Linux Ubuntu"/><category term="ECSHOP"/><category term="生活記錄"/><category term="資訊新鮮事"/><category term="Drupal"/><category term="Joomla"/><category term="Xampp"/><category term="電腦疑難雜症"/><category term="Zen Cart"/><category term="程式語法"/><category term="Access"/><category term="SEO優化"/><category term="實用軟體"/><category term="網路管理"/><category term="Blogger設定"/><title type='text'>威筆記</title><subtitle type='html'>『威筆記』知識累積、經驗分享。分享是知識的累積、分享是加倍的喜悅。熱愛資訊、努力累積自我無形資產</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://tgw1029.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2893139382062216061/posts/default'/><link rel='alternate' type='text/html' href='http://tgw1029.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><link rel='next' type='application/atom+xml' href='http://www.blogger.com/feeds/2893139382062216061/posts/default?start-index=26&amp;max-results=25'/><author><name>威筆記</name><uri>http://www.blogger.com/profile/03781053564980189303</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>118</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-2893139382062216061.post-6603930228775773909</id><published>2010-05-09T22:08:00.002+08:00</published><updated>2010-05-09T22:14:40.274+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="網路管理"/><title type='text'>ipconfig 指令參數說明</title><content type='html'>在Windows命令提示字元中(cmd)，&lt;strong&gt;ipconfig&lt;/strong&gt;是Windows系統的TCP/IP應用程式指令，其用途為顯示本機電腦的&lt;strong&gt;IP位址&lt;/strong&gt;與相關配置資訊。&lt;strong&gt;ipconfig&lt;/strong&gt;對於網路的故障排除有著重要的作用，其參數指令直覺且易用。&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;color: blue;&quot;&gt;語法：&lt;/span&gt;&lt;br /&gt;ipconfig&amp;nbsp; [/參數]&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;color: #ff8000;&quot;&gt;參數說明：&lt;/span&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;&lt;strong&gt;/all&lt;/strong&gt;&lt;br /&gt;顯示網路卡的TCP/IP所有完整配置資訊。&lt;/li&gt;&lt;li&gt;&lt;strong&gt;/renew &lt;/strong&gt;&lt;strong&gt;[adapter]&lt;/strong&gt;&lt;br /&gt;用於需重新配置DHCP的網路卡。(此參數只可用於設定為自動DHCP配置IP位址的環境下)&lt;/li&gt;&lt;li&gt;&lt;strong&gt;/release &lt;strong&gt;[adapter]&lt;/strong&gt;&lt;/strong&gt;&lt;br /&gt;要求DHCP釋放(丟棄)網路卡的IP位址。&lt;/li&gt;&lt;li&gt;&lt;strong&gt;/displaydns&lt;/strong&gt;&lt;br /&gt;顯示DNS快取內容。&lt;/li&gt;&lt;li&gt;&lt;strong&gt;/flushdns&lt;/strong&gt;&lt;br /&gt;重新刷新清理DNS快取。&lt;/li&gt;&lt;li&gt;&lt;strong&gt;/registerdns&lt;/strong&gt;&lt;br /&gt;重新註冊(初始化)IP位址與DNS名稱。&lt;/li&gt;&lt;li&gt;&lt;strong&gt;/showclassid &lt;strong&gt;[adapter]&lt;/strong&gt;&lt;/strong&gt;&lt;br /&gt;顯示網路卡的DHCP類別ID。&lt;/li&gt;&lt;li&gt;&lt;strong&gt;/setclassid &lt;strong&gt;[adapter]&lt;/strong&gt;&lt;/strong&gt;&lt;br /&gt;配置網路卡的DHCP類別ID。&lt;/li&gt;&lt;li&gt;&lt;strong&gt;/?&lt;/strong&gt;&lt;br /&gt;顯示ipconfig的參數說明。&lt;/li&gt;&lt;/ul&gt;</content><link rel='replies' type='application/atom+xml' href='http://tgw1029.blogspot.com/feeds/6603930228775773909/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://tgw1029.blogspot.com/2010/05/ipconfig.html#comment-form' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2893139382062216061/posts/default/6603930228775773909'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2893139382062216061/posts/default/6603930228775773909'/><link rel='alternate' type='text/html' href='http://tgw1029.blogspot.com/2010/05/ipconfig.html' title='ipconfig 指令參數說明'/><author><name>威筆記</name><uri>http://www.blogger.com/profile/03781053564980189303</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2893139382062216061.post-191091073685822141</id><published>2010-05-03T21:57:00.001+08:00</published><updated>2010-05-03T21:58:54.359+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Asp.Net"/><title type='text'>讓Chrome瀏覽器支援MaintainScrollPositionOnPostback屬性</title><content type='html'>&lt;p&gt;&lt;a href=&quot;http://msdn.microsoft.com/zh-tw/library/system.web.ui.page.maintainscrollpositiononpostback%28VS.80%29.aspx&quot; target=&quot;_blank&quot;&gt;&lt;strong&gt;MaintainScrollPositionOnPostback&lt;/strong&gt;&lt;/a&gt;主要功能是在Asp.Net的Page中取得或設定值，指出在回傳後是否將使用者返回用戶端瀏覽器中的相同位置。簡單的說就是讓頁面在PostBack後還能保持頁面位置。&lt;br&gt;&lt;br&gt;即使我們在Page中設定了MaintainScrollPositionOnPostback為True，但在最近市佔率越來越高的&lt;a href=&quot;http://www.google.com/chrome/index.html?hl=zh-TW&amp;amp;brand=CHMA&amp;amp;utm_campaign=zh_hk&amp;amp;utm_source=zh-TW-ha-apac-tw-bk&amp;amp;utm_medium=ha&quot; target=&quot;_blank&quot;&gt;Chrome&lt;/a&gt;這個&lt;strong&gt;&lt;/strong&gt;以速度快著名的Goolge瀏覽器卻是失效了。&lt;br&gt;&lt;br&gt;自己在遇這個問題後，在Google找到此站提供的方式解決了我的問題：&lt;br&gt;&lt;a href=&quot;http://blog.uni2.tw/post/2009/07/17/e8ae93Chromee7808fe8a6bde599a8e694afe68fb4AspNete79a84MaintainScrollPositionOnPostback.aspx&quot; target=&quot;_blank&quot;&gt;讓Chrome瀏覽器支援Asp.Net的MaintainScrollPositionOnPostback&lt;/a&gt;&lt;br&gt;但此網頁已失連許久，也在Google找不到相同提供解決方法的網頁(也許有，我沒找到)。因此特地在此記錄並提供給有遇到同樣問題的朋友一個解決的辦法。&lt;br&gt;&lt;br&gt;&lt;strong&gt;&lt;font color=&quot;#0000ff&quot;&gt;解決方法：&lt;/font&gt;&lt;/strong&gt;&lt;br&gt;首先在Asp.Net中新增一個瀏覽器定義檔，我們要使用這個定義檔來根據不同瀏覽器設定不同運行環境參數。&lt;br&gt;&lt;a href=&quot;http://lh5.ggpht.com/_2sQfBxJU9mI/S97WKYaZkeI/AAAAAAAAMC4/bq0FluxrsA4/s1600-h/2010-05-03_213205%5B4%5D.jpg&quot;&gt;&lt;img style=&quot;border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px&quot; title=&quot;2010-05-03_213205&quot; border=&quot;0&quot; alt=&quot;2010-05-03_213205&quot; src=&quot;http://lh4.ggpht.com/_2sQfBxJU9mI/S97WLl8bfRI/AAAAAAAAMC8/myelQix8otU/2010-05-03_213205_thumb%5B2%5D.jpg?imgmax=800&quot; width=&quot;504&quot; height=&quot;337&quot;&gt;&lt;/a&gt;&amp;nbsp;&lt;br&gt;.browser建立後預設會放在App_Browesers資料夾中。打開.browser後將以下程式碼直接複製貼上：&lt;/p&gt; &lt;div style=&quot;border-bottom: silver 1px solid; text-align: left; border-left: silver 1px solid; padding-bottom: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; padding-left: 4px; width: 97.5%; padding-right: 4px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; max-height: 200px; font-size: 8pt; overflow: auto; border-top: silver 1px solid; cursor: text; border-right: silver 1px solid; padding-top: 4px&quot; id=&quot;codeSnippetWrapper&quot;&gt; &lt;div style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot; id=&quot;codeSnippet&quot;&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #0000ff&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #800000&quot;&gt;browsers&lt;/span&gt;&lt;span style=&quot;color: #0000ff&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot;&gt;    &lt;span style=&quot;color: #0000ff&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #800000&quot;&gt;browser&lt;/span&gt; &lt;span style=&quot;color: #ff0000&quot;&gt;id&lt;/span&gt;&lt;span style=&quot;color: #0000ff&quot;&gt;=&quot;Safari3&quot;&lt;/span&gt; &lt;span style=&quot;color: #ff0000&quot;&gt;parentID&lt;/span&gt;&lt;span style=&quot;color: #0000ff&quot;&gt;=&quot;Safari1Plus&quot;&lt;/span&gt;&lt;span style=&quot;color: #0000ff&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot;&gt;        &lt;span style=&quot;color: #0000ff&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #800000&quot;&gt;identification&lt;/span&gt;&lt;span style=&quot;color: #0000ff&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot;&gt;            &lt;span style=&quot;color: #0000ff&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #800000&quot;&gt;userAgent&lt;/span&gt; &lt;span style=&quot;color: #ff0000&quot;&gt;match&lt;/span&gt;&lt;span style=&quot;color: #0000ff&quot;&gt;=&quot;Safari/\d+\.\d+&quot;&lt;/span&gt; &lt;span style=&quot;color: #0000ff&quot;&gt;/&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot;&gt;        &lt;span style=&quot;color: #0000ff&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span style=&quot;color: #800000&quot;&gt;identification&lt;/span&gt;&lt;span style=&quot;color: #0000ff&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot;&gt;        &lt;span style=&quot;color: #0000ff&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #800000&quot;&gt;capture&lt;/span&gt;&lt;span style=&quot;color: #0000ff&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot;&gt;            &lt;span style=&quot;color: #0000ff&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #800000&quot;&gt;userAgent&lt;/span&gt; &lt;span style=&quot;color: #ff0000&quot;&gt;match&lt;/span&gt;&lt;span style=&quot;color: #0000ff&quot;&gt;=&quot;Version/(?&#39;version&#39;\d+\.\d+)&quot;&lt;/span&gt; &lt;span style=&quot;color: #0000ff&quot;&gt;/&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot;&gt;        &lt;span style=&quot;color: #0000ff&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span style=&quot;color: #800000&quot;&gt;capture&lt;/span&gt;&lt;span style=&quot;color: #0000ff&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot;&gt;        &lt;span style=&quot;color: #0000ff&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #800000&quot;&gt;capabilities&lt;/span&gt;&lt;span style=&quot;color: #0000ff&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot;&gt;            &lt;span style=&quot;color: #0000ff&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #800000&quot;&gt;capability&lt;/span&gt; &lt;span style=&quot;color: #ff0000&quot;&gt;name&lt;/span&gt;&lt;span style=&quot;color: #0000ff&quot;&gt;=&quot;browser&quot;&lt;/span&gt; &lt;span style=&quot;color: #ff0000&quot;&gt;value&lt;/span&gt;&lt;span style=&quot;color: #0000ff&quot;&gt;=&quot;Safari3&quot;&lt;/span&gt; &lt;span style=&quot;color: #0000ff&quot;&gt;/&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot;&gt;            &lt;span style=&quot;color: #0000ff&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #800000&quot;&gt;capability&lt;/span&gt; &lt;span style=&quot;color: #ff0000&quot;&gt;name&lt;/span&gt;&lt;span style=&quot;color: #0000ff&quot;&gt;=&quot;version&quot;&lt;/span&gt; &lt;span style=&quot;color: #ff0000&quot;&gt;value&lt;/span&gt;&lt;span style=&quot;color: #0000ff&quot;&gt;=&quot;${version}&quot;&lt;/span&gt; &lt;span style=&quot;color: #0000ff&quot;&gt;/&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot;&gt;        &lt;span style=&quot;color: #0000ff&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span style=&quot;color: #800000&quot;&gt;capabilities&lt;/span&gt;&lt;span style=&quot;color: #0000ff&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot;&gt;        &lt;span style=&quot;color: #0000ff&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #800000&quot;&gt;controlAdapters&lt;/span&gt;&lt;span style=&quot;color: #0000ff&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot;&gt;            &lt;span style=&quot;color: #0000ff&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #800000&quot;&gt;adapter&lt;/span&gt; &lt;span style=&quot;color: #ff0000&quot;&gt;controlType&lt;/span&gt;&lt;span style=&quot;color: #0000ff&quot;&gt;=&quot;System.Web.UI.WebControls.Menu&quot;&lt;/span&gt;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot;&gt;                     &lt;span style=&quot;color: #ff0000&quot;&gt;adapterType&lt;/span&gt;&lt;span style=&quot;color: #0000ff&quot;&gt;=&quot;&quot;&lt;/span&gt; &lt;span style=&quot;color: #0000ff&quot;&gt;/&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot;&gt;        &lt;span style=&quot;color: #0000ff&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span style=&quot;color: #800000&quot;&gt;controlAdapters&lt;/span&gt;&lt;span style=&quot;color: #0000ff&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot;&gt;    &lt;span style=&quot;color: #0000ff&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span style=&quot;color: #800000&quot;&gt;browser&lt;/span&gt;&lt;span style=&quot;color: #0000ff&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot;&gt;    &lt;span style=&quot;color: #0000ff&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #800000&quot;&gt;browser&lt;/span&gt; &lt;span style=&quot;color: #ff0000&quot;&gt;id&lt;/span&gt;&lt;span style=&quot;color: #0000ff&quot;&gt;=&quot;GoogleChrome&quot;&lt;/span&gt; &lt;span style=&quot;color: #ff0000&quot;&gt;parentID&lt;/span&gt;&lt;span style=&quot;color: #0000ff&quot;&gt;=&quot;Safari3&quot;&lt;/span&gt;&lt;span style=&quot;color: #0000ff&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot;&gt;        &lt;span style=&quot;color: #0000ff&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #800000&quot;&gt;identification&lt;/span&gt;&lt;span style=&quot;color: #0000ff&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot;&gt;            &lt;span style=&quot;color: #0000ff&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #800000&quot;&gt;userAgent&lt;/span&gt; &lt;span style=&quot;color: #ff0000&quot;&gt;match&lt;/span&gt;&lt;span style=&quot;color: #0000ff&quot;&gt;=&quot;Chrome/(?&#39;version&#39;\d+\.\d+)&quot;&lt;/span&gt; &lt;span style=&quot;color: #0000ff&quot;&gt;/&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot;&gt;        &lt;span style=&quot;color: #0000ff&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span style=&quot;color: #800000&quot;&gt;identification&lt;/span&gt;&lt;span style=&quot;color: #0000ff&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot;&gt;        &lt;span style=&quot;color: #0000ff&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #800000&quot;&gt;capabilities&lt;/span&gt;&lt;span style=&quot;color: #0000ff&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot;&gt;            &lt;span style=&quot;color: #0000ff&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #800000&quot;&gt;capability&lt;/span&gt; &lt;span style=&quot;color: #ff0000&quot;&gt;name&lt;/span&gt;&lt;span style=&quot;color: #0000ff&quot;&gt;=&quot;browser&quot;&lt;/span&gt; &lt;span style=&quot;color: #ff0000&quot;&gt;value&lt;/span&gt;&lt;span style=&quot;color: #0000ff&quot;&gt;=&quot;Googlebot&quot;&lt;/span&gt; &lt;span style=&quot;color: #0000ff&quot;&gt;/&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot;&gt;            &lt;span style=&quot;color: #0000ff&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #800000&quot;&gt;capability&lt;/span&gt; &lt;span style=&quot;color: #ff0000&quot;&gt;name&lt;/span&gt;&lt;span style=&quot;color: #0000ff&quot;&gt;=&quot;supportsMaintainScrollPositionOnPostback&quot;&lt;/span&gt; &lt;span style=&quot;color: #ff0000&quot;&gt;value&lt;/span&gt;&lt;span style=&quot;color: #0000ff&quot;&gt;=&quot;true&quot;&lt;/span&gt; &lt;span style=&quot;color: #0000ff&quot;&gt;/&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot;&gt;        &lt;span style=&quot;color: #0000ff&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span style=&quot;color: #800000&quot;&gt;capabilities&lt;/span&gt;&lt;span style=&quot;color: #0000ff&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot;&gt;    &lt;span style=&quot;color: #0000ff&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span style=&quot;color: #800000&quot;&gt;browser&lt;/span&gt;&lt;span style=&quot;color: #0000ff&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #0000ff&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span style=&quot;color: #800000&quot;&gt;browsers&lt;/span&gt;&lt;span style=&quot;color: #0000ff&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;/div&gt;&lt;/div&gt;&lt;br /&gt;&lt;p&gt;&lt;br&gt;上面這段程式碼原本主要的用途是用來解決Asp.Net中的Menu控制項，在Chrom與Safari瀏覽器下顯示不完全的問題。詳情可以參考：&lt;a href=&quot;http://www.cnblogs.com/Whikiey/archive/2009/03/03/1402463.html&quot; target=&quot;_blank&quot;&gt;最簡單的方法，讓 ASP.NET Menu 控件在 Google Chrome 瀏覽器上正常顯示&lt;/a&gt;&lt;br&gt;&lt;br&gt;按照原作者的方法直接在GoogleChrome的定義中加入這一行程式碼：&lt;br&gt;&lt;font color=&quot;#ff0000&quot;&gt;&lt;strong&gt;&amp;lt;capability name=&quot;supportsMaintainScrollPositionOnPostback&quot; value=&quot;true&quot; /&amp;gt;&lt;br&gt;&lt;/strong&gt;&lt;font color=&quot;#000000&quot;&gt;&lt;br&gt;如此即可解決MaintainScrollPositionOnPostback在Chrome瀏覽器失效的問題了，可謂一舉兩得。&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;  </content><link rel='replies' type='application/atom+xml' href='http://tgw1029.blogspot.com/feeds/191091073685822141/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://tgw1029.blogspot.com/2010/05/chromemaintainscrollpositiononpostback.html#comment-form' title='2 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2893139382062216061/posts/default/191091073685822141'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2893139382062216061/posts/default/191091073685822141'/><link rel='alternate' type='text/html' href='http://tgw1029.blogspot.com/2010/05/chromemaintainscrollpositiononpostback.html' title='讓Chrome瀏覽器支援MaintainScrollPositionOnPostback屬性'/><author><name>威筆記</name><uri>http://www.blogger.com/profile/03781053564980189303</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://lh4.ggpht.com/_2sQfBxJU9mI/S97WLl8bfRI/AAAAAAAAMC8/myelQix8otU/s72-c/2010-05-03_213205_thumb%5B2%5D.jpg?imgmax=800" height="72" width="72"/><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2893139382062216061.post-3058996984593503111</id><published>2010-05-03T21:09:00.001+08:00</published><updated>2010-05-03T21:09:26.112+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Asp.Net"/><title type='text'>解決FileUpload上傳超過4M大檔案時瀏覽器出現錯誤訊息</title><content type='html'>&lt;p&gt;在Asp.Net中若使用FileUpload控制項實作檔案上傳時，除了在上傳按鈕事件中可以使用FileUpload.PostedFile.ContentLength來取得檔案大小來限制使用者上傳檔案大小之外，另外一個我們都會遇到的必需去解決的課題，是在Asp.Net環境中系統預設了最大上傳容量為4M(4096KB)。因此若網站User在上傳的檔案超過4M瀏覽器就會出現錯誤訊息，而User殊不知是自己上傳了過大檔案導致，以為是系統故障了。&lt;br&gt;&lt;br&gt;Asp.Net會有此一限制，是為了能夠避免『&lt;a href=&quot;http://zh.wikipedia.org/zh-tw/%E5%88%86%E6%95%A3%E5%BC%8F%E9%98%BB%E6%96%B7%E6%9C%8D%E5%8B%99%E6%94%BB%E6%93%8A&quot; target=&quot;_blank&quot;&gt;分散式阻斷服務攻擊&lt;/a&gt;』(DDoS)，免去一些在不懂資安情況之下得到最小限度的保護措施。&lt;br&gt;&lt;br&gt;既然系統幫我們預設了最大上傳，當然爾我們也可以依照個人不同需求來調整這個預設值。設定的方法很簡單，我們只需在&lt;strong&gt;Web.Config&lt;/strong&gt;檔中指定&lt;/p&gt;&lt;a href=&quot;http://msdn.microsoft.com/zh-tw/library/e1f13641(VS.80).aspx&quot; target=&quot;_blank&quot;&gt;&lt;strong&gt;httpRuntime&lt;/strong&gt;&lt;/a&gt;項目的屬性即可。 &lt;div style=&quot;border-bottom: silver 1px solid; text-align: left; border-left: silver 1px solid; padding-bottom: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; padding-left: 4px; width: 97.5%; padding-right: 4px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; max-height: 200px; font-size: 8pt; overflow: auto; border-top: silver 1px solid; cursor: text; border-right: silver 1px solid; padding-top: 4px&quot; id=&quot;codeSnippetWrapper&quot;&gt; &lt;div style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot; id=&quot;codeSnippet&quot;&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #0000ff&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #800000&quot;&gt;system.web&lt;/span&gt;&lt;span style=&quot;color: #0000ff&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot;&gt;    &lt;span style=&quot;color: #0000ff&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #800000&quot;&gt;httpRuntime&lt;/span&gt; &lt;span style=&quot;color: #ff0000&quot;&gt;executionTimeout&lt;/span&gt; = &lt;span style=&quot;color: #0000ff&quot;&gt;&quot;1800&quot;&lt;/span&gt; &lt;span style=&quot;color: #ff0000&quot;&gt;maxRequestLength&lt;/span&gt;&lt;span style=&quot;color: #0000ff&quot;&gt;=&quot;100000&quot;&lt;/span&gt; &lt;span style=&quot;color: #0000ff&quot;&gt;/&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #0000ff&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span style=&quot;color: #800000&quot;&gt;system.web&lt;/span&gt;&lt;span style=&quot;color: #0000ff&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;/div&gt;&lt;/div&gt;&lt;br /&gt;&lt;p&gt;&lt;b&gt;&lt;br&gt;executionTimeout&lt;/b&gt;屬性：以秒為單位，代表網頁執行期間所需執行最大秒數(預設是90秒)，若網頁執行超過設定值時間會發生TimeOut的情況。&lt;br&gt;&lt;b&gt;maxRequestLength&lt;/b&gt;屬性：以KB為單位，指定輸入資料流緩衝臨界值的限制，也就是我們所需指定允許最大上傳容量設定值(預設值為4096KB)。&lt;br&gt;&lt;br&gt;&lt;font color=&quot;#808080&quot;&gt;補充：&lt;br&gt;&lt;/font&gt;若需自訂超過檔案限制大小時瀏覽器出現錯誤時的頁面，可於Web.Config中設定&lt;a href=&quot;http://msdn.microsoft.com/zh-tw/library/h0hfz6fc(VS.80).aspx&quot; target=&quot;_blank&quot;&gt;customErrors&lt;/a&gt;項目，自行指定錯誤發生時所需顯示的頁面：&lt;br&gt;&amp;lt;customErrors mode=&quot;On&quot; defaultRedirect=&quot;ErrorPage.aspx&quot; /&amp;gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;更多內容可參考：&lt;br&gt;&lt;a href=&quot;http://blogs.msdn.com/jchiou/archive/2008/03/10/asp-net-4mb.aspx&quot; target=&quot;_blank&quot;&gt;ASP.NET 無法上載大型檔案(大於 4MB)&lt;/a&gt;&lt;br&gt;&lt;a href=&quot;http://blog.miniasp.com/?tag=/maxrequestlength&quot; target=&quot;_blank&quot;&gt;ASP.NET 當上傳檔案過大時任何回應瀏覽器的動作都無效&lt;/a&gt;&lt;/p&gt;  </content><link rel='replies' type='application/atom+xml' href='http://tgw1029.blogspot.com/feeds/3058996984593503111/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://tgw1029.blogspot.com/2010/05/fileupload4m.html#comment-form' title='3 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2893139382062216061/posts/default/3058996984593503111'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2893139382062216061/posts/default/3058996984593503111'/><link rel='alternate' type='text/html' href='http://tgw1029.blogspot.com/2010/05/fileupload4m.html' title='解決FileUpload上傳超過4M大檔案時瀏覽器出現錯誤訊息'/><author><name>威筆記</name><uri>http://www.blogger.com/profile/03781053564980189303</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2893139382062216061.post-8802354782848626218</id><published>2010-04-29T22:07:00.001+08:00</published><updated>2010-04-29T22:07:02.113+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Asp.Net"/><title type='text'>[Tips] 在Asp.Net中替VB.Net一次多行註解</title><content type='html'>&lt;p&gt;使用VB.Net寫Asp.Net的人一定都知道要註解VB程式碼的方法，直接在要註解那行程式碼最前端加上 &#39; 號。&lt;br&gt;&lt;br&gt;使用C#可以使用 // 來註解單行，亦可使用 /*&amp;nbsp; */ 來包覆程式碼達到多行註解的功能。那VB如何使用多行註解？很抱歉…VB並不支援多行註解。雖然如此，VB的Programmers也無需過於擔心，若使用的開發軟體為Vistual Studio ，就不需要自己一行一行手動Key &#39; 號註解了。&lt;br&gt;&lt;br&gt;&lt;font color=&quot;#ff8000&quot;&gt;&lt;strong&gt;VB.Net多行註解方法：&lt;br&gt;&lt;/strong&gt;&lt;/font&gt;&lt;font color=&quot;#000000&quot;&gt;在Vistual Studio上方工具列可以找到如下圖『&lt;strong&gt;註解選取行&lt;/strong&gt;』的按鈕&lt;br&gt;&lt;a href=&quot;http://lh4.ggpht.com/_2sQfBxJU9mI/S9mSWsx420I/AAAAAAAAMCI/ut_LsKLai20/s1600-h/2010-04-29_214952%5B4%5D.jpg&quot;&gt;&lt;img style=&quot;border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px&quot; title=&quot;2010-04-29_214952&quot; border=&quot;0&quot; alt=&quot;2010-04-29_214952&quot; src=&quot;http://lh6.ggpht.com/_2sQfBxJU9mI/S9mSXWP_yAI/AAAAAAAAMCM/k9XgaXTL8UM/2010-04-29_214952_thumb%5B2%5D.jpg?imgmax=800&quot; width=&quot;504&quot; height=&quot;109&quot;&gt;&lt;/a&gt; &lt;/font&gt;&lt;/p&gt; &lt;p&gt;&lt;br&gt;若沒找到，試著從&lt;strong&gt;檢視→工具列→文字編輯器&lt;/strong&gt;，將其工具列打開&lt;br&gt;&lt;a href=&quot;http://lh3.ggpht.com/_2sQfBxJU9mI/S9mSYPyFbcI/AAAAAAAAMCQ/Hz6bgkSWLVo/s1600-h/2010-04-29_215106%5B3%5D.jpg&quot;&gt;&lt;img style=&quot;border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px&quot; title=&quot;2010-04-29_215106&quot; border=&quot;0&quot; alt=&quot;2010-04-29_215106&quot; src=&quot;http://lh3.ggpht.com/_2sQfBxJU9mI/S9mSZIlVToI/AAAAAAAAMCU/RJo8tt5v410/2010-04-29_215106_thumb%5B1%5D.jpg?imgmax=800&quot; width=&quot;504&quot; height=&quot;350&quot;&gt;&lt;/a&gt; &lt;/p&gt; &lt;p&gt;&lt;br&gt;OK!接著就是將欲註解的程式碼反白後，直接按下『&lt;strong&gt;註解選取行&lt;/strong&gt;』按鈕&lt;br&gt;&lt;a href=&quot;http://lh4.ggpht.com/_2sQfBxJU9mI/S9mSZ4SPkZI/AAAAAAAAMCY/lRQxuw_L3eU/s1600-h/2010-04-29_215212%5B3%5D.jpg&quot;&gt;&lt;img style=&quot;border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px&quot; title=&quot;2010-04-29_215212&quot; border=&quot;0&quot; alt=&quot;2010-04-29_215212&quot; src=&quot;http://lh3.ggpht.com/_2sQfBxJU9mI/S9mSa5wmUwI/AAAAAAAAMCc/4zO4UB__S4E/2010-04-29_215212_thumb%5B1%5D.jpg?imgmax=800&quot; width=&quot;504&quot; height=&quot;300&quot;&gt;&lt;/a&gt; &lt;/p&gt; &lt;p&gt;&lt;br&gt;最後結果所有被反白的程式碼都加上了 &#39; 號註解了，非常容易又方便呀!&lt;br&gt;&lt;a href=&quot;http://lh3.ggpht.com/_2sQfBxJU9mI/S9mSbtmnJxI/AAAAAAAAMCg/2OF2zZ6je2k/s1600-h/2010-04-29_215253%5B3%5D.jpg&quot;&gt;&lt;img style=&quot;border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px&quot; title=&quot;2010-04-29_215253&quot; border=&quot;0&quot; alt=&quot;2010-04-29_215253&quot; src=&quot;http://lh6.ggpht.com/_2sQfBxJU9mI/S9mScl1OwII/AAAAAAAAMCk/aav2j4-MGnY/2010-04-29_215253_thumb%5B1%5D.jpg?imgmax=800&quot; width=&quot;504&quot; height=&quot;316&quot;&gt;&lt;/a&gt; &lt;/p&gt; &lt;p&gt;&lt;br&gt;取消多行註解的方式也一樣，反白程式碼後點擊『&lt;strong&gt;取消註解選取行&lt;/strong&gt;』按鈕即可。&lt;br&gt;&lt;a href=&quot;http://lh5.ggpht.com/_2sQfBxJU9mI/S9mSdd1SdOI/AAAAAAAAMCo/AKBN58v_A0c/s1600-h/2010-04-29_215334%5B3%5D.jpg&quot;&gt;&lt;img style=&quot;border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px&quot; title=&quot;2010-04-29_215334&quot; border=&quot;0&quot; alt=&quot;2010-04-29_215334&quot; src=&quot;http://lh4.ggpht.com/_2sQfBxJU9mI/S9mSfEEmzYI/AAAAAAAAMCs/VmoT0-Wf5uw/2010-04-29_215334_thumb%5B1%5D.jpg?imgmax=800&quot; width=&quot;504&quot; height=&quot;164&quot;&gt;&lt;/a&gt; &lt;/p&gt; &lt;p&gt;&lt;br&gt;或想自己使用&lt;strong&gt;Alt+左鍵&lt;/strong&gt;選取區塊的方式將多行註解選取起來再按下Del鍵刪除也可，看個人習慣囉!&lt;br&gt;&lt;a href=&quot;http://lh4.ggpht.com/_2sQfBxJU9mI/S9mSgFveTrI/AAAAAAAAMCw/AQAoZVqPTUE/s1600-h/2010-04-29_220336%5B3%5D.jpg&quot;&gt;&lt;img style=&quot;border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px&quot; title=&quot;2010-04-29_220336&quot; border=&quot;0&quot; alt=&quot;2010-04-29_220336&quot; src=&quot;http://lh3.ggpht.com/_2sQfBxJU9mI/S9mShVoEzoI/AAAAAAAAMC0/R2UnW8oY8qs/2010-04-29_220336_thumb%5B1%5D.jpg?imgmax=800&quot; width=&quot;504&quot; height=&quot;248&quot;&gt;&lt;/a&gt;&lt;/p&gt;  </content><link rel='replies' type='application/atom+xml' href='http://tgw1029.blogspot.com/feeds/8802354782848626218/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://tgw1029.blogspot.com/2010/04/tips-aspnetvbnet.html#comment-form' title='1 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2893139382062216061/posts/default/8802354782848626218'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2893139382062216061/posts/default/8802354782848626218'/><link rel='alternate' type='text/html' href='http://tgw1029.blogspot.com/2010/04/tips-aspnetvbnet.html' title='[Tips] 在Asp.Net中替VB.Net一次多行註解'/><author><name>威筆記</name><uri>http://www.blogger.com/profile/03781053564980189303</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://lh6.ggpht.com/_2sQfBxJU9mI/S9mSXWP_yAI/AAAAAAAAMCM/k9XgaXTL8UM/s72-c/2010-04-29_214952_thumb%5B2%5D.jpg?imgmax=800" height="72" width="72"/><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2893139382062216061.post-6329712705059242374</id><published>2010-04-29T21:31:00.001+08:00</published><updated>2010-04-29T21:31:36.547+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Asp.Net"/><title type='text'>[Tips] 移除ViewState值的兩種寫法</title><content type='html'>&lt;p&gt;VB.Net寫法：&lt;br&gt;&lt;br&gt;1、將ViewState(&quot;Test&quot;)值移除&lt;/p&gt; &lt;p&gt;&lt;strong&gt;&lt;font color=&quot;#0000ff&quot;&gt;ViewState.Remove(&quot;Test&quot;)&lt;/font&gt;&lt;/strong&gt;&lt;br&gt;&lt;br&gt;or&lt;br&gt;&lt;br&gt;2、ViewState(&quot;Test&quot;)值設為Null&lt;br&gt;&lt;strong&gt;&lt;font color=&quot;#0000ff&quot;&gt;ViewState(&quot;Test&quot;) = DBNull.Value&lt;/font&gt;&lt;/strong&gt;&lt;/p&gt;  </content><link rel='replies' type='application/atom+xml' href='http://tgw1029.blogspot.com/feeds/6329712705059242374/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://tgw1029.blogspot.com/2010/04/tips-viewstate.html#comment-form' title='7 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2893139382062216061/posts/default/6329712705059242374'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2893139382062216061/posts/default/6329712705059242374'/><link rel='alternate' type='text/html' href='http://tgw1029.blogspot.com/2010/04/tips-viewstate.html' title='[Tips] 移除ViewState值的兩種寫法'/><author><name>威筆記</name><uri>http://www.blogger.com/profile/03781053564980189303</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>7</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2893139382062216061.post-8975750497768352307</id><published>2010-04-28T21:39:00.002+08:00</published><updated>2010-04-28T21:40:08.907+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="資訊新鮮事"/><title type='text'>想做你的CODE：Vistual Studio 2010全球發佈會宣傳影片</title><content type='html'>『&lt;b&gt;想做你的CODE&lt;/b&gt;』：&lt;b&gt;更痛快地CODING，給愛更多好心情……&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;Programer時最容易犯的毛病，除了CODING卻忽略身邊太多的事物，這挺符合Vistual Studio強調的快速開發。&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;div class=&quot;wlWriterEditableSmartContent&quot; id=&quot;scid:5737277B-5D6D-4f48-ABFC-DD9C333F4C5D:c3bbaf46-ef83-4c80-a398-c74610c4c2e4&quot; style=&quot;display: inline; float: none; margin: 0px; padding: 0px;&quot;&gt;&lt;div id=&quot;99bda722-b388-4525-b36b-e4c1b1e21499&quot; style=&quot;display: inline; margin: 0px; padding: 0px;&quot;&gt;&lt;div&gt;&lt;a href=&quot;http://www.youtube.com/watch?v=0gliakvtTgs&amp;amp;hl=zh_TW&amp;amp;fs=1&amp;amp;&quot; target=&quot;_new&quot;&gt;&lt;img alt=&quot;&quot; galleryimg=&quot;no&quot; onload=&quot;var downlevelDiv = document.getElementById(&#39;99bda722-b388-4525-b36b-e4c1b1e21499&#39;); downlevelDiv.innerHTML = &amp;quot;&amp;lt;div&amp;gt;&amp;lt;object width=\&amp;quot;425\&amp;quot; height=\&amp;quot;355\&amp;quot;&amp;gt;&amp;lt;param name=\&amp;quot;movie\&amp;quot; value=\&amp;quot;http://www.youtube.com/v/0gliakvtTgs&amp;amp;hl=zh_TW&amp;amp;fs=1&amp;amp;&amp;amp;hl=en\&amp;quot;&amp;gt;&amp;lt;\/param&amp;gt;&amp;lt;embed src=\&amp;quot;http://www.youtube.com/v/0gliakvtTgs&amp;amp;hl=zh_TW&amp;amp;fs=1&amp;amp;&amp;amp;hl=en\&amp;quot; type=\&amp;quot;application/x-shockwave-flash\&amp;quot; width=\&amp;quot;425\&amp;quot; height=\&amp;quot;355\&amp;quot;&amp;gt;&amp;lt;\/embed&amp;gt;&amp;lt;\/object&amp;gt;&amp;lt;\/div&amp;gt;&amp;quot;;&quot; src=&quot;http://lh6.ggpht.com/_2sQfBxJU9mI/S9g6ht0jH2I/AAAAAAAAMCE/AuPEh2f-SpY/videof823711f3060%5B4%5D.jpg?imgmax=800&quot; style=&quot;border-style: none;&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://tgw1029.blogspot.com/feeds/8975750497768352307/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://tgw1029.blogspot.com/2010/04/codevistual-studio-2010.html#comment-form' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2893139382062216061/posts/default/8975750497768352307'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2893139382062216061/posts/default/8975750497768352307'/><link rel='alternate' type='text/html' href='http://tgw1029.blogspot.com/2010/04/codevistual-studio-2010.html' title='想做你的CODE：Vistual Studio 2010全球發佈會宣傳影片'/><author><name>威筆記</name><uri>http://www.blogger.com/profile/03781053564980189303</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://lh6.ggpht.com/_2sQfBxJU9mI/S9g6ht0jH2I/AAAAAAAAMCE/AuPEh2f-SpY/s72-c/videof823711f3060%5B4%5D.jpg?imgmax=800" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2893139382062216061.post-7580507865702070782</id><published>2010-04-27T22:44:00.001+08:00</published><updated>2010-04-27T22:44:57.094+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Asp.Net"/><title type='text'>解決Asp.net網站佈署至國外虛擬主機日期格式不同的問題</title><content type='html'>&lt;p&gt;若您與我一樣使用的是國外虛擬主機運作Asp.Net網站，可能需要注意一下在不同語系的Server系統上，會產生不同日期格式的問題。由於國外虛擬主機用的是英文版的Windows Server，網站中若有使用到DateTime抓取系統時間也會自動顯示為國外的日期格式。&lt;br&gt;&lt;br&gt;雖然DateTime可加上ToString來自訂日期格式，如DateTime.ToString(&quot;yyyy/MM/dd HH:mm:ss&quot;)，但某些Asp.Net的extender也會跟著系統的語系顯示不同語系，如Ajax ControlToolKit 的CalendarExtender。&lt;br&gt;&lt;br&gt;要避免此問題最方便的方法是直接在&lt;strong&gt;Web.Config&lt;/strong&gt;檔案中指定網站程式預設語系為zh-Tw(中文)語系。&lt;br&gt;&lt;br&gt;&lt;font color=&quot;#ff8000&quot;&gt;設定方法：&lt;/font&gt;&lt;br&gt;在Web.Config檔中加入&lt;br&gt;&amp;lt;system.web&amp;gt;&lt;/p&gt; &lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;strong&gt;&lt;font color=&quot;#0000ff&quot;&gt;&amp;lt;globalization culture=&quot;zh-TW&#39; /&amp;gt;&lt;/font&gt;&lt;/strong&gt;&lt;/p&gt; &lt;p&gt;&amp;lt;/system.web&amp;gt;&lt;br&gt;&lt;br&gt;如此不管使用的運行的Server語系為何，網站都會以中文語系顯示了。&lt;/p&gt;  </content><link rel='replies' type='application/atom+xml' href='http://tgw1029.blogspot.com/feeds/7580507865702070782/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://tgw1029.blogspot.com/2010/04/aspnet.html#comment-form' title='1 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2893139382062216061/posts/default/7580507865702070782'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2893139382062216061/posts/default/7580507865702070782'/><link rel='alternate' type='text/html' href='http://tgw1029.blogspot.com/2010/04/aspnet.html' title='解決Asp.net網站佈署至國外虛擬主機日期格式不同的問題'/><author><name>威筆記</name><uri>http://www.blogger.com/profile/03781053564980189303</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2893139382062216061.post-6370073518173448616</id><published>2010-04-27T22:16:00.002+08:00</published><updated>2010-04-27T22:19:30.018+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Asp.Net"/><title type='text'>設定Html編輯器FreeTextBox在Enter換行時為&lt;br&gt;</title><content type='html'>最近在一個專案中使用了免費版的&lt;b&gt;&lt;a href=&quot;http://www.freetextbox.com/&quot; target=&quot;_blank&quot;&gt;FreeTextBox&lt;/a&gt;&lt;/b&gt;線上Html編輯器，發現的問題是在FreeTextBox編輯內容按下Enter鍵換行時，不同瀏覽器下的換行行距會有所不同。&lt;br /&gt;&lt;br /&gt;以下為各瀏覽器在FreeTextBox下Enter鍵預設輸出的語法：&lt;br /&gt;Firefox → &amp;lt;br&amp;gt;&lt;br /&gt;Chrome → &amp;lt;div&amp;gt;&lt;br /&gt;IE8 → &amp;lt;p&amp;gt;&amp;lt;/p&amp;gt;&lt;br /&gt;Opera → &amp;lt;p&amp;gt;&amp;lt;/p&amp;gt;&lt;br /&gt;&lt;br /&gt;顯然的IE8與Opera的&amp;lt;p&amp;gt;段落即為造成換行行距過大的問題所在。因不可能告知所有網站User要換行請使用Shift+Enter來產生&amp;lt;br&amp;gt;換行，我希望找到方法使得Enter預設值可由&amp;lt;p&amp;gt;段落改為使用&amp;lt;br&amp;gt;換行語法。&lt;br /&gt;&lt;br /&gt;在FreeTextBox中有個屬性值為&lt;span style=&quot;color: blue;&quot;&gt;&lt;b&gt;BreakMode&lt;/b&gt;&lt;span style=&quot;color: black;&quot;&gt;&lt;b&gt;，&lt;/b&gt;說明文件&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;對屬性解釋如下：&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: navy;&quot;&gt;&lt;span style=&quot;color: green;&quot;&gt;.BreakMode&lt;br /&gt;Sets&amp;nbsp;&amp;nbsp; what&amp;nbsp;&amp;nbsp; happens&amp;nbsp;&amp;nbsp; when&amp;nbsp;&amp;nbsp; the&amp;nbsp;&amp;nbsp; &quot;Enter&quot;&amp;nbsp;&amp;nbsp; key&amp;nbsp;&amp;nbsp; is&amp;nbsp;&amp;nbsp; pressed.&amp;nbsp;&amp;nbsp; Options&amp;nbsp;&amp;nbsp; are&amp;nbsp;&amp;nbsp; LineBreak&amp;nbsp;&amp;nbsp; (IE&amp;nbsp;&amp;nbsp; and&amp;nbsp;&amp;nbsp; Mozilla)&amp;nbsp;&amp;nbsp; and&amp;nbsp;&amp;nbsp; Paragraph&amp;nbsp;&amp;nbsp; (IE&amp;nbsp;&amp;nbsp; only)&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;FreeTextBox的BreakMode預設值為Paragraph(段落)，因此只要設定&lt;b&gt;&lt;span style=&quot;color: red;&quot;&gt;BreakMode=&quot;LineBreak&quot; &lt;/span&gt;&lt;/b&gt;即可將預設&amp;lt;p&amp;gt;更改為&amp;lt;br&amp;gt;。&lt;br /&gt;&lt;br /&gt;根據說明文件可以得知設定LineBreak模式只能影響IE與FireFox瀏覽器，在Chrome及Opera是無效的，這點需要特別注意一下。</content><link rel='replies' type='application/atom+xml' href='http://tgw1029.blogspot.com/feeds/6370073518173448616/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://tgw1029.blogspot.com/2010/04/htmlfreetextboxenter.html#comment-form' title='2 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2893139382062216061/posts/default/6370073518173448616'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2893139382062216061/posts/default/6370073518173448616'/><link rel='alternate' type='text/html' href='http://tgw1029.blogspot.com/2010/04/htmlfreetextboxenter.html' title='設定Html編輯器FreeTextBox在Enter換行時為&amp;lt;br&amp;gt;'/><author><name>威筆記</name><uri>http://www.blogger.com/profile/03781053564980189303</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2893139382062216061.post-3762060835848567629</id><published>2010-04-22T21:44:00.001+08:00</published><updated>2010-04-22T21:44:48.819+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Asp.Net"/><title type='text'>SqlDataSource設計模式中SelectCommand使用If…Else條件</title><content type='html'>&lt;p&gt;一般來說我們都會將使用codebehind的方式來指定SqlDataSource的SelectCommand內容。但在比較複雜的邏輯程式中不得已必須在設計模式中直接指定SelectCommand內容，又需要對某控制項來取值作為SQL中的Where條件時，我們可以使用T-SQL中的條件語法If…Else來實現。&lt;br&gt;&lt;br&gt;&lt;/p&gt; &lt;p&gt;&lt;strong&gt;T-SQL If…Else 架構：&lt;/strong&gt;&lt;br&gt;&lt;font color=&quot;#0000ff&quot;&gt;If&amp;nbsp; 條件式&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Begin&lt;/font&gt;&lt;/p&gt; &lt;p&gt;&lt;font color=&quot;#0000ff&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; T-SQL語法&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; End&lt;br&gt;Else&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Begin&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; T-SQL語法&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; End&lt;br&gt;&lt;br&gt;&lt;/font&gt;&lt;font color=&quot;#000000&quot;&gt;Begin End是用來設定T-SQL程式碼範圍，若你的T-SQL語法超過一行請務必記得加上Begin End，否則你會發現就算寫了多行也只會執行第一行程式。最好是養成不管一行多行程式都用Begin….End包起來的好習慣。&lt;br&gt;&lt;br&gt;&lt;strong&gt;範例：&lt;/strong&gt;&lt;br&gt;在SqlDataSource的SelectCommand對DropDownList控制項取值，判斷DropDownList值是否為All來達成不同條件資料過濾。&lt;br&gt;&lt;br&gt;DropDownList內容：&lt;/font&gt;&lt;/p&gt; &lt;div style=&quot;border-bottom: silver 1px solid; text-align: left; border-left: silver 1px solid; padding-bottom: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; padding-left: 4px; width: 97.5%; padding-right: 4px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; max-height: 200px; font-size: 8pt; overflow: auto; border-top: silver 1px solid; cursor: text; border-right: silver 1px solid; padding-top: 4px&quot; id=&quot;codeSnippetWrapper&quot;&gt; &lt;div style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot; id=&quot;codeSnippet&quot;&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #0000ff&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #800000&quot;&gt;asp:DropDownList&lt;/span&gt; &lt;span style=&quot;color: #ff0000&quot;&gt;ID&lt;/span&gt;&lt;span style=&quot;color: #0000ff&quot;&gt;=&quot;DropDownList&quot;&lt;/span&gt; &lt;span style=&quot;color: #ff0000&quot;&gt;runat&lt;/span&gt;&lt;span style=&quot;color: #0000ff&quot;&gt;=&quot;server&quot;&lt;/span&gt; &lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot;&gt;    &lt;span style=&quot;color: #ff0000&quot;&gt;AppendDataBoundItems&lt;/span&gt;&lt;span style=&quot;color: #0000ff&quot;&gt;=&quot;True&quot;&lt;/span&gt; &lt;span style=&quot;color: #ff0000&quot;&gt;DataSourceID&lt;/span&gt;&lt;span style=&quot;color: #0000ff&quot;&gt;=&quot;Sort_SqlDataSource&quot;&lt;/span&gt; &lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot;&gt;    &lt;span style=&quot;color: #ff0000&quot;&gt;DataTextField&lt;/span&gt;&lt;span style=&quot;color: #0000ff&quot;&gt;=&quot;分類項目&quot;&lt;/span&gt; &lt;span style=&quot;color: #ff0000&quot;&gt;DataValueField&lt;/span&gt;&lt;span style=&quot;color: #0000ff&quot;&gt;=&quot;分類編號&quot;&lt;/span&gt;&lt;span style=&quot;color: #0000ff&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot;&gt;    &lt;span style=&quot;color: #0000ff&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #800000&quot;&gt;asp:ListItem&lt;/span&gt; &lt;span style=&quot;color: #ff0000&quot;&gt;Value&lt;/span&gt;&lt;span style=&quot;color: #0000ff&quot;&gt;=&quot;All&quot;&lt;/span&gt;&lt;span style=&quot;color: #0000ff&quot;&gt;&amp;gt;&lt;/span&gt;請選擇&lt;span style=&quot;color: #0000ff&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span style=&quot;color: #800000&quot;&gt;asp:ListItem&lt;/span&gt;&lt;span style=&quot;color: #0000ff&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #0000ff&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span style=&quot;color: #800000&quot;&gt;asp:DropDownList&lt;/span&gt;&lt;span style=&quot;color: #0000ff&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #0000ff&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #800000&quot;&gt;asp:SqlDataSource&lt;/span&gt; &lt;span style=&quot;color: #ff0000&quot;&gt;ID&lt;/span&gt;&lt;span style=&quot;color: #0000ff&quot;&gt;=&quot;Sort_SqlDataSource&quot;&lt;/span&gt; &lt;span style=&quot;color: #ff0000&quot;&gt;runat&lt;/span&gt;&lt;span style=&quot;color: #0000ff&quot;&gt;=&quot;server&quot;&lt;/span&gt; &lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot;&gt;    &lt;span style=&quot;color: #ff0000&quot;&gt;ConnectionString&lt;/span&gt;&lt;span style=&quot;color: #0000ff&quot;&gt;=&quot;&amp;lt;%$ ConnectionStrings:TestConnectionString %&amp;gt;&quot;&lt;/span&gt; &lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot;&gt;    &lt;span style=&quot;color: #ff0000&quot;&gt;SelectCommand&lt;/span&gt;&lt;span style=&quot;color: #0000ff&quot;&gt;=&quot;SELECT * FROM 分類&quot;&lt;/span&gt;&lt;span style=&quot;color: #0000ff&quot;&gt;&amp;gt;&amp;lt;/&lt;/span&gt;&lt;span style=&quot;color: #800000&quot;&gt;asp:SqlDataSource&lt;/span&gt;&lt;span style=&quot;color: #0000ff&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;/div&gt;&lt;/div&gt;&lt;br&gt;SqlDataSource SelectCommand內容：&lt;br&gt;&lt;br /&gt;&lt;div style=&quot;border-bottom: silver 1px solid; text-align: left; border-left: silver 1px solid; padding-bottom: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; padding-left: 4px; width: 97.5%; padding-right: 4px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; max-height: 200px; font-size: 8pt; overflow: auto; border-top: silver 1px solid; cursor: text; border-right: silver 1px solid; padding-top: 4px&quot; id=&quot;codeSnippetWrapper&quot;&gt;&lt;br /&gt;&lt;div style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot; id=&quot;codeSnippet&quot;&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #0000ff&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #800000&quot;&gt;asp:SqlDataSource&lt;/span&gt; &lt;span style=&quot;color: #ff0000&quot;&gt;ID&lt;/span&gt;&lt;span style=&quot;color: #0000ff&quot;&gt;=&quot;SqlDataSource&quot;&lt;/span&gt; &lt;span style=&quot;color: #ff0000&quot;&gt;runat&lt;/span&gt;&lt;span style=&quot;color: #0000ff&quot;&gt;=&quot;server&quot;&lt;/span&gt;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot;&gt;        &lt;span style=&quot;color: #ff0000&quot;&gt;ConnectionString&lt;/span&gt;&lt;span style=&quot;color: #0000ff&quot;&gt;=&quot;&amp;lt;%$ ConnectionStrings:TestConnectionString %&amp;gt;&quot;&lt;/span&gt;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot;&gt;        &lt;span style=&quot;color: #ff0000&quot;&gt;SelectCommand&lt;/span&gt;&lt;span style=&quot;color: #0000ff&quot;&gt;=&quot;if (@分類項目=&#39;All&#39;) begin Select * From 測試 end else begin Select * From 測試 Where 分類項目=@分類項目 end&quot;&lt;/span&gt;&lt;span style=&quot;color: #0000ff&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot;&gt;        &lt;span style=&quot;color: #0000ff&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #800000&quot;&gt;SelectParameters&lt;/span&gt;&lt;span style=&quot;color: #0000ff&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot;&gt;            &lt;span style=&quot;color: #0000ff&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #800000&quot;&gt;asp:ControlParameter&lt;/span&gt; &lt;span style=&quot;color: #ff0000&quot;&gt;ControlID&lt;/span&gt;&lt;span style=&quot;color: #0000ff&quot;&gt;=&quot;DropDownList&quot;&lt;/span&gt; &lt;span style=&quot;color: #ff0000&quot;&gt;Name&lt;/span&gt;&lt;span style=&quot;color: #0000ff&quot;&gt;=&quot;分類項目&quot;&lt;/span&gt; &lt;span style=&quot;color: #ff0000&quot;&gt;PropertyName&lt;/span&gt;&lt;span style=&quot;color: #0000ff&quot;&gt;=&quot;SelectedValue&quot;&lt;/span&gt; &lt;span style=&quot;color: #0000ff&quot;&gt;/&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot;&gt;        &lt;span style=&quot;color: #0000ff&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span style=&quot;color: #800000&quot;&gt;SelectParameters&lt;/span&gt;&lt;span style=&quot;color: #0000ff&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot;&gt; &lt;span style=&quot;color: #0000ff&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span style=&quot;color: #800000&quot;&gt;asp:SqlDataSource&lt;/span&gt;&lt;span style=&quot;color: #0000ff&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;/div&gt;&lt;/div&gt;  </content><link rel='replies' type='application/atom+xml' href='http://tgw1029.blogspot.com/feeds/3762060835848567629/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://tgw1029.blogspot.com/2010/04/sqldatasourceselectcommandifelse.html#comment-form' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2893139382062216061/posts/default/3762060835848567629'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2893139382062216061/posts/default/3762060835848567629'/><link rel='alternate' type='text/html' href='http://tgw1029.blogspot.com/2010/04/sqldatasourceselectcommandifelse.html' title='SqlDataSource設計模式中SelectCommand使用If…Else條件'/><author><name>威筆記</name><uri>http://www.blogger.com/profile/03781053564980189303</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2893139382062216061.post-365026771057909910</id><published>2010-04-15T20:37:00.001+08:00</published><updated>2010-04-15T20:37:18.042+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Asp.Net"/><title type='text'>[Ajax]CalendarExtender與TextBox的ReadOnly設為True取不到值的解決方法</title><content type='html'>&lt;p&gt;使用CalendarExtender控制項時通常一定會搭配TextBox控制項，且定會想將TexBox欄位設為唯讀來防止User自行輸入一些不符合資料庫欄位規格的日期格式。&lt;br&gt;&lt;br&gt;然而從Asp.Net 2.0開始若將TextBox設為ReadOnly後會發現，在PostBack後卻無法順利取得TextBox.Text值，這是Asp.Net 2.0後基於安全性考量而作的改變。&lt;br&gt;&lt;br&gt;&lt;font color=&quot;#0000ff&quot;&gt;解決方法：&lt;br&gt;&lt;/font&gt;&lt;font color=&quot;#000000&quot;&gt;不在設計模式中設定TextBox的唯獨屬性，而在codebehind的Page_Load事件中使用&lt;a href=&quot;http://msdn.microsoft.com/zh-tw/library/system.web.ui.webcontrols.webcontrol.attributes%28VS.80%29.aspx&quot;&gt;WebControl.Attributes&lt;/a&gt; 屬性動態加入唯獨屬性的設定。&lt;/font&gt;&lt;/p&gt; &lt;div style=&quot;border-bottom: silver 1px solid; text-align: left; border-left: silver 1px solid; padding-bottom: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; padding-left: 4px; width: 97.5%; padding-right: 4px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; max-height: 200px; font-size: 8pt; overflow: auto; border-top: silver 1px solid; cursor: text; border-right: silver 1px solid; padding-top: 4px&quot; id=&quot;codeSnippetWrapper&quot;&gt; &lt;div style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot; id=&quot;codeSnippet&quot;&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #0000ff&quot;&gt;Protected&lt;/span&gt; &lt;span style=&quot;color: #0000ff&quot;&gt;Sub&lt;/span&gt; Page_Load(&lt;span style=&quot;color: #0000ff&quot;&gt;ByVal&lt;/span&gt; sender &lt;span style=&quot;color: #0000ff&quot;&gt;As&lt;/span&gt; &lt;span style=&quot;color: #0000ff&quot;&gt;Object&lt;/span&gt;, &lt;span style=&quot;color: #0000ff&quot;&gt;ByVal&lt;/span&gt; e &lt;span style=&quot;color: #0000ff&quot;&gt;As&lt;/span&gt; System.EventArgs) &lt;span style=&quot;color: #0000ff&quot;&gt;Handles&lt;/span&gt; &lt;span style=&quot;color: #0000ff&quot;&gt;Me&lt;/span&gt;.Load&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot;&gt;    &lt;span style=&quot;color: #0000ff&quot;&gt;If&lt;/span&gt; &lt;span style=&quot;color: #0000ff&quot;&gt;Not&lt;/span&gt; IsPostBack &lt;span style=&quot;color: #0000ff&quot;&gt;Then&lt;/span&gt;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot;&gt;           TextBox.Attributes.Add(&lt;span style=&quot;color: #006080&quot;&gt;&quot;readonly&quot;&lt;/span&gt;, &lt;span style=&quot;color: #006080&quot;&gt;&quot;true&quot;&lt;/span&gt;)&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot;&gt;    &lt;span style=&quot;color: #0000ff&quot;&gt;End&lt;/span&gt; &lt;span style=&quot;color: #0000ff&quot;&gt;If&lt;/span&gt;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #0000ff&quot;&gt;End&lt;/span&gt; Sub&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;/div&gt;&lt;/div&gt;  </content><link rel='replies' type='application/atom+xml' href='http://tgw1029.blogspot.com/feeds/365026771057909910/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://tgw1029.blogspot.com/2010/04/ajaxcalendarextendertextboxreadonlytrue.html#comment-form' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2893139382062216061/posts/default/365026771057909910'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2893139382062216061/posts/default/365026771057909910'/><link rel='alternate' type='text/html' href='http://tgw1029.blogspot.com/2010/04/ajaxcalendarextendertextboxreadonlytrue.html' title='[Ajax]CalendarExtender與TextBox的ReadOnly設為True取不到值的解決方法'/><author><name>威筆記</name><uri>http://www.blogger.com/profile/03781053564980189303</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2893139382062216061.post-2594619284010349837</id><published>2010-04-14T22:51:00.001+08:00</published><updated>2010-04-14T22:54:13.746+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Asp.Net"/><title type='text'>解決[Ajax]CalendarExtender彈出時被GridView或其它物件遮擋的問題</title><content type='html'>&lt;p&gt;&lt;a href=&quot;http://lh6.ggpht.com/_2sQfBxJU9mI/S8XWZfEXUKI/AAAAAAAAMB0/OastlHbh764/s1600-h/2010-04-14_223340%5B4%5D.jpg&quot;&gt;&lt;img style=&quot;border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px&quot; title=&quot;2010-04-14_223340&quot; border=&quot;0&quot; alt=&quot;2010-04-14_223340&quot; src=&quot;http://lh6.ggpht.com/_2sQfBxJU9mI/S8XWafRbHtI/AAAAAAAAMB4/dnB3U4cFIvM/2010-04-14_223340_thumb%5B2%5D.jpg?imgmax=800&quot; width=&quot;504&quot; height=&quot;195&quot;&gt;&lt;/a&gt; &lt;/p&gt; &lt;p&gt;&lt;br&gt;上圖的CalendarExtender日曆控制項彈出時被下方的GridView Header 的Div Css擋住了。我們必須使CalendarExtender能永遠顯示在畫面最頂端，&lt;br&gt;正常的情況應該如下圖：&lt;br&gt;&lt;br&gt;&lt;a href=&quot;http://lh4.ggpht.com/_2sQfBxJU9mI/S8XWbhY80sI/AAAAAAAAMB8/Y3_19T8ltfQ/s1600-h/2010-04-14_223408%5B3%5D.jpg&quot;&gt;&lt;img style=&quot;border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px&quot; title=&quot;2010-04-14_223408&quot; border=&quot;0&quot; alt=&quot;2010-04-14_223408&quot; src=&quot;http://lh6.ggpht.com/_2sQfBxJU9mI/S8XWck7WtbI/AAAAAAAAMCA/9dP_dxjA0N4/2010-04-14_223408_thumb%5B1%5D.jpg?imgmax=800&quot; width=&quot;504&quot; height=&quot;196&quot;&gt;&lt;/a&gt; &lt;/p&gt; &lt;p&gt;&lt;br&gt;&lt;font color=&quot;#0000ff&quot;&gt;解決方法：&lt;/font&gt;&lt;br&gt;我們將寫一個Css並將其指定給CalendarExtender：&lt;/p&gt; &lt;div style=&quot;border-bottom: silver 1px solid; text-align: left; border-left: silver 1px solid; padding-bottom: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; padding-left: 4px; width: 97.5%; padding-right: 4px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; max-height: 200px; font-size: 8pt; overflow: auto; border-top: silver 1px solid; cursor: text; border-right: silver 1px solid; padding-top: 4px&quot; id=&quot;codeSnippetWrapper&quot;&gt; &lt;div style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot; id=&quot;codeSnippet&quot;&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #0000ff&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #800000&quot;&gt;ajaxtoolkit:calendarextender&lt;/span&gt; &lt;span style=&quot;color: #ff0000&quot;&gt;ID&lt;/span&gt;&lt;span style=&quot;color: #0000ff&quot;&gt;=&quot;CalendarExtender&quot;&lt;/span&gt; &lt;span style=&quot;color: #ff0000&quot;&gt;runat&lt;/span&gt;&lt;span style=&quot;color: #0000ff&quot;&gt;=&quot;server&quot;&lt;/span&gt;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot;&gt; &lt;span style=&quot;color: #ff0000&quot;&gt;TargetControlID&lt;/span&gt;&lt;span style=&quot;color: #0000ff&quot;&gt;=&quot;Date&quot;&lt;/span&gt; &lt;span style=&quot;color: #ff0000&quot;&gt;PopupButtonID&lt;/span&gt;&lt;span style=&quot;color: #0000ff&quot;&gt;=&quot;Calendar_Image&quot;&lt;/span&gt; &lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #ff0000&quot;&gt;Format&lt;/span&gt;&lt;span style=&quot;color: #0000ff&quot;&gt;=&quot;yyyy/MM/dd&quot;&lt;/span&gt; &lt;span style=&quot;color: #ff0000&quot;&gt;FirstDayOfWeek&lt;/span&gt;&lt;span style=&quot;color: #0000ff&quot;&gt;=&quot;Monday&quot;&lt;/span&gt; &lt;span style=&quot;color: #ff0000&quot;&gt;CssClass&lt;/span&gt;&lt;span style=&quot;color: #0000ff&quot;&gt;=&quot;cssCalendar&quot;&lt;/span&gt;&lt;span style=&quot;color: #0000ff&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;/div&gt;&lt;/div&gt;&lt;br /&gt;&lt;p&gt;&lt;br&gt;CalendarExtender CSS內容中將月曆控制項指定z-index屬性。z-index是用來指定圖層的層數，例如z-index:1為最底層，z-index:2為第2層以此類推。&lt;br&gt;最重要的是需將此CSS 的z-index屬性寫在&lt;strong&gt;.ajax__calendar_container&lt;br&gt;&lt;/strong&gt;代表將整個CalendarExtender 容器的層數設為最頂層(除非你自己故意將其它Div設到1001層否則CalendarExtender 會在最頂層)&lt;br&gt;&lt;br&gt;如：&lt;/p&gt;&lt;br /&gt;&lt;p&gt;.cssCalendar .ajax__calendar_container&lt;br&gt;{&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; z-index:1000;&lt;br&gt;}&lt;/p&gt;  </content><link rel='replies' type='application/atom+xml' href='http://tgw1029.blogspot.com/feeds/2594619284010349837/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://tgw1029.blogspot.com/2010/04/calendarextendergridview.html#comment-form' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2893139382062216061/posts/default/2594619284010349837'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2893139382062216061/posts/default/2594619284010349837'/><link rel='alternate' type='text/html' href='http://tgw1029.blogspot.com/2010/04/calendarextendergridview.html' title='解決[Ajax]CalendarExtender彈出時被GridView或其它物件遮擋的問題'/><author><name>威筆記</name><uri>http://www.blogger.com/profile/03781053564980189303</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://lh6.ggpht.com/_2sQfBxJU9mI/S8XWafRbHtI/AAAAAAAAMB4/dnB3U4cFIvM/s72-c/2010-04-14_223340_thumb%5B2%5D.jpg?imgmax=800" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2893139382062216061.post-846811042122293874</id><published>2010-04-14T22:23:00.001+08:00</published><updated>2010-04-14T22:25:45.214+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Asp.Net"/><title type='text'>GridView實作資料筆數、頁數統計(使用SqlDataSource繫結方式)</title><content type='html'>&lt;p&gt;&lt;a href=&quot;http://lh4.ggpht.com/_2sQfBxJU9mI/S8XP9zaLaqI/AAAAAAAAMBs/GlDcP5WCKoU/s1600-h/2010-04-14_220709%5B4%5D.jpg&quot;&gt;&lt;img style=&quot;border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px&quot; title=&quot;2010-04-14_220709&quot; border=&quot;0&quot; alt=&quot;2010-04-14_220709&quot; src=&quot;http://lh5.ggpht.com/_2sQfBxJU9mI/S8XP_H6TAyI/AAAAAAAAMBw/2v2dnury-gA/2010-04-14_220709_thumb%5B2%5D.jpg?imgmax=800&quot; width=&quot;504&quot; height=&quot;341&quot;&gt;&lt;/a&gt; &lt;/p&gt; &lt;p&gt;&lt;br&gt;在此要介紹的是使用GridView指定DataSourceID為SqlDataSource的資料繫結方式情況下，實現如上圖統計GridView的資料筆數與分頁數功能。&lt;br&gt;&lt;br&gt;&lt;font color=&quot;#0000ff&quot;&gt;計算GridView筆數：&lt;/font&gt;&lt;/p&gt; &lt;div style=&quot;border-bottom: silver 1px solid; text-align: left; border-left: silver 1px solid; padding-bottom: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; padding-left: 4px; width: 97.5%; padding-right: 4px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; max-height: 200px; font-size: 8pt; overflow: auto; border-top: silver 1px solid; cursor: text; border-right: silver 1px solid; padding-top: 4px&quot; id=&quot;codeSnippetWrapper&quot;&gt; &lt;div style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot; id=&quot;codeSnippet&quot;&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #008000&quot;&gt;&#39;計算筆數&lt;/span&gt;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #0000ff&quot;&gt;Protected&lt;/span&gt; &lt;span style=&quot;color: #0000ff&quot;&gt;Sub&lt;/span&gt; SqlDataSource_Selected(&lt;span style=&quot;color: #0000ff&quot;&gt;ByVal&lt;/span&gt; sender &lt;span style=&quot;color: #0000ff&quot;&gt;As&lt;/span&gt; &lt;span style=&quot;color: #0000ff&quot;&gt;Object&lt;/span&gt;, &lt;span style=&quot;color: #0000ff&quot;&gt;ByVal&lt;/span&gt; e &lt;span style=&quot;color: #0000ff&quot;&gt;As&lt;/span&gt; System.Web.UI.WebControls.SqlDataSourceStatusEventArgs) &lt;span style=&quot;color: #0000ff&quot;&gt;Handles&lt;/span&gt; SqlDataSource.Selected&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot;&gt;    CountLots.Text = &lt;span style=&quot;color: #006080&quot;&gt;&quot;合計&quot;&lt;/span&gt; + e.AffectedRows.ToString() + &lt;span style=&quot;color: #006080&quot;&gt;&quot;筆&quot;&lt;/span&gt;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #0000ff&quot;&gt;End&lt;/span&gt; Sub&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;/div&gt;&lt;/div&gt;&lt;br /&gt;&lt;p&gt;&lt;font color=&quot;#808080&quot;&gt;注意：利用 SqlDataSource取得資料受影響筆數必須要將DataSourceMode設為DataSet，否則取得的筆數皆為0。&lt;/font&gt;&lt;br&gt;&lt;br&gt;&lt;font color=&quot;#0000ff&quot;&gt;計算GridView頁數：&lt;/font&gt;&lt;/p&gt;&lt;br /&gt;&lt;div style=&quot;border-bottom: silver 1px solid; text-align: left; border-left: silver 1px solid; padding-bottom: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; padding-left: 4px; width: 97.5%; padding-right: 4px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; max-height: 200px; font-size: 8pt; overflow: auto; border-top: silver 1px solid; cursor: text; border-right: silver 1px solid; padding-top: 4px&quot; id=&quot;codeSnippetWrapper&quot;&gt;&lt;br /&gt;&lt;div style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot; id=&quot;codeSnippet&quot;&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #008000&quot;&gt;&#39;計算頁數&lt;/span&gt;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #0000ff&quot;&gt;Protected&lt;/span&gt; &lt;span style=&quot;color: #0000ff&quot;&gt;Sub&lt;/span&gt; GridView_DataBound(&lt;span style=&quot;color: #0000ff&quot;&gt;ByVal&lt;/span&gt; sender &lt;span style=&quot;color: #0000ff&quot;&gt;As&lt;/span&gt; &lt;span style=&quot;color: #0000ff&quot;&gt;Object&lt;/span&gt;, &lt;span style=&quot;color: #0000ff&quot;&gt;ByVal&lt;/span&gt; e &lt;span style=&quot;color: #0000ff&quot;&gt;As&lt;/span&gt; System.EventArgs) &lt;span style=&quot;color: #0000ff&quot;&gt;Handles&lt;/span&gt; GridView.DataBound&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot;&gt;    &lt;span style=&quot;color: #0000ff&quot;&gt;If&lt;/span&gt; &lt;span style=&quot;color: #0000ff&quot;&gt;Not&lt;/span&gt; CountPage &lt;span style=&quot;color: #0000ff&quot;&gt;Is&lt;/span&gt; &lt;span style=&quot;color: #0000ff&quot;&gt;Nothing&lt;/span&gt; &lt;span style=&quot;color: #0000ff&quot;&gt;Then&lt;/span&gt;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot;&gt;        &lt;span style=&quot;color: #0000ff&quot;&gt;Dim&lt;/span&gt; currentPage &lt;span style=&quot;color: #0000ff&quot;&gt;As&lt;/span&gt; &lt;span style=&quot;color: #0000ff&quot;&gt;Integer&lt;/span&gt; = GridView.PageIndex + 1&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot;&gt;        CountPage.Text = &lt;span style=&quot;color: #006080&quot;&gt;&quot; 共&quot;&lt;/span&gt; &amp;amp; GridView.PageCount.ToString() &amp;amp; &lt;span style=&quot;color: #006080&quot;&gt;&quot;頁&quot;&lt;/span&gt;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot;&gt;    &lt;span style=&quot;color: #0000ff&quot;&gt;End&lt;/span&gt; &lt;span style=&quot;color: #0000ff&quot;&gt;If&lt;/span&gt;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #0000ff&quot;&gt;End&lt;/span&gt; Sub&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;/div&gt;&lt;/div&gt;  </content><link rel='replies' type='application/atom+xml' href='http://tgw1029.blogspot.com/feeds/846811042122293874/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://tgw1029.blogspot.com/2010/04/gridviewsqldatasource.html#comment-form' title='3 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2893139382062216061/posts/default/846811042122293874'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2893139382062216061/posts/default/846811042122293874'/><link rel='alternate' type='text/html' href='http://tgw1029.blogspot.com/2010/04/gridviewsqldatasource.html' title='GridView實作資料筆數、頁數統計(使用SqlDataSource繫結方式)'/><author><name>威筆記</name><uri>http://www.blogger.com/profile/03781053564980189303</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://lh5.ggpht.com/_2sQfBxJU9mI/S8XP_H6TAyI/AAAAAAAAMBw/2v2dnury-gA/s72-c/2010-04-14_220709_thumb%5B2%5D.jpg?imgmax=800" height="72" width="72"/><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2893139382062216061.post-8565242160232138162</id><published>2010-04-14T21:53:00.001+08:00</published><updated>2010-04-14T21:53:27.530+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Asp.Net"/><title type='text'>Asp.net加密Web.config檔的資料庫&lt;connectionStrings&gt;連線資訊內容</title><content type='html'>&lt;p&gt;在&lt;strong&gt;Web.config&lt;/strong&gt;檔中的&lt;strong&gt;&amp;lt;connectionString&amp;gt;&lt;/strong&gt;區段儲存的是資料庫的連線資訊，包含主機IP、資料庫登入帳號、密碼等等重要機密資訊。因此在將網站正式上線以前必須作的其中一項重要事情，便是將&amp;lt;connectionString&amp;gt;區段中的重要資訊經過加密轉換，在此我們選擇使用&lt;a href=&quot;http://msdn.microsoft.com/zh-tw/library/system.configuration.rsaprotectedconfigurationprovider%28VS.80%29.aspx&quot;&gt;RsaProtectedConfigurationProvider&lt;/a&gt;類別的加密解密方式來實現保護&amp;lt;connectionString&amp;gt;的功能。&lt;br&gt;&lt;br&gt;&lt;font color=&quot;#0000ff&quot;&gt;加密方法：&lt;/font&gt;&lt;br&gt;1、從開始→執行中輸入cmd指令來開啟DOS指令視窗&lt;br&gt;2、在DOS視窗中我們需要先切換至.NET Framework目錄下來執行：因此&amp;nbsp; 輸入&lt;strong&gt;cd \WINDOWS\Microsoft.Net\Framework\v2.0.*&lt;br&gt;&lt;/strong&gt;3、在此目錄下有支&lt;b&gt;aspnet_regiis&lt;/b&gt;.exe的程式，我們使用此支執行檔來實現加密的功能：輸入&lt;strong&gt;aspnet_regiis -pe &quot;connectionStrings&quot; -app &quot;/網站名&quot; -prov &quot;RSAProtectedConfigurationProvider&quot;&lt;br&gt;&lt;a href=&quot;http://lh5.ggpht.com/_2sQfBxJU9mI/S8XI0YyiSLI/AAAAAAAAMBk/zk10Qd_flEg/s1600-h/2010-04-14_215143%5B4%5D.jpg&quot;&gt;&lt;img style=&quot;border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px&quot; title=&quot;2010-04-14_215143&quot; border=&quot;0&quot; alt=&quot;2010-04-14_215143&quot; src=&quot;http://lh3.ggpht.com/_2sQfBxJU9mI/S8XI1pkLJgI/AAAAAAAAMBo/GyI_bVlTzEY/2010-04-14_215143_thumb%5B2%5D.jpg?imgmax=800&quot; width=&quot;504&quot; height=&quot;176&quot;&gt;&lt;/a&gt;&amp;nbsp;&lt;br&gt;&lt;/strong&gt;&lt;font color=&quot;#0000ff&quot;&gt;解密方法：&lt;/font&gt;&lt;br&gt;1、同上先切換至.NET Framework目錄下來執行&lt;b&gt;aspnet_regiis&lt;/b&gt;.exe的程式&lt;br&gt;2、輸入&lt;strong&gt;aspnet_regiis -pd &quot;connectionStrings&quot; -app &quot;/網站名&quot; -prov &quot;RSAProtectedConfigurationProvider&quot;&lt;br&gt;&lt;br&gt;&lt;/strong&gt;&lt;font color=&quot;#ff80c0&quot;&gt;參數說明：&lt;/font&gt;&lt;/p&gt; &lt;p&gt;-pe : 加密 &lt;p&gt;-pd : 解密 &lt;p&gt;-app : 欲加密的網站目錄名稱 &lt;p&gt;-prov : 加密方式&lt;/p&gt;  </content><link rel='replies' type='application/atom+xml' href='http://tgw1029.blogspot.com/feeds/8565242160232138162/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://tgw1029.blogspot.com/2010/04/aspnetwebconfig.html#comment-form' title='1 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2893139382062216061/posts/default/8565242160232138162'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2893139382062216061/posts/default/8565242160232138162'/><link rel='alternate' type='text/html' href='http://tgw1029.blogspot.com/2010/04/aspnetwebconfig.html' title='Asp.net加密Web.config檔的資料庫&amp;lt;connectionStrings&amp;gt;連線資訊內容'/><author><name>威筆記</name><uri>http://www.blogger.com/profile/03781053564980189303</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://lh3.ggpht.com/_2sQfBxJU9mI/S8XI1pkLJgI/AAAAAAAAMBo/GyI_bVlTzEY/s72-c/2010-04-14_215143_thumb%5B2%5D.jpg?imgmax=800" height="72" width="72"/><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2893139382062216061.post-175429521990619742</id><published>2010-04-14T21:03:00.001+08:00</published><updated>2010-04-14T21:03:21.874+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Asp.Net"/><title type='text'>剖析器錯誤訊息：無法從組件……載入型別……(解決方法)</title><content type='html'>&lt;p&gt;&lt;strong&gt;剖析器錯誤訊息: 無法從組件 &lt;/strong&gt;&lt;/p&gt; &lt;p&gt;&lt;strong&gt;&#39;System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35&#39; &lt;/strong&gt;&lt;/p&gt; &lt;p&gt;&lt;strong&gt;載入型別 &#39;System.Web.UI.Compatibility.CompareValidator&#39;。&lt;/strong&gt;&lt;br&gt;&lt;br&gt;錯誤原因：&lt;br&gt;在Asp.Net網頁運行時出現此訊息，代表您運行的網站程式碼中使用了Ajax Control Toolkit For .NET3.5 SP1版本的控制項；而運行的Visual Studio 2008 環境未安裝SP1更新補丁。&lt;br&gt;&lt;br&gt;解決方法：&lt;br&gt;下載&lt;a href=&quot;http://www.microsoft.com/downloads/details.aspx?FamilyId=27673C47-B3B5-4C67-BD99-84E525B5CE61&amp;amp;displaylang=en&quot;&gt;Visual Studio 2008 Sp1&lt;/a&gt;(ISO檔)後安裝更新檔即可。&lt;/p&gt;  </content><link rel='replies' type='application/atom+xml' href='http://tgw1029.blogspot.com/feeds/175429521990619742/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://tgw1029.blogspot.com/2010/04/blog-post.html#comment-form' title='1 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2893139382062216061/posts/default/175429521990619742'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2893139382062216061/posts/default/175429521990619742'/><link rel='alternate' type='text/html' href='http://tgw1029.blogspot.com/2010/04/blog-post.html' title='剖析器錯誤訊息：無法從組件……載入型別……(解決方法)'/><author><name>威筆記</name><uri>http://www.blogger.com/profile/03781053564980189303</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2893139382062216061.post-2677783701141349398</id><published>2010-04-06T19:57:00.001+08:00</published><updated>2010-04-06T19:57:51.408+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Asp.Net"/><title type='text'>Asp.Net -Cookie讀取中文變亂碼的解決方法</title><content type='html'>&lt;p&gt;有時我的可能因為特別需求，必須使用Cookie來存放簡短的中文字。但中文字的編碼與Cookie預設的編碼方式不同，因此必須先行在URL傳輸過程中經過一道編碼、解碼的程序，才不會發生中文字在Cookie中讀取出來為亂碼的情況。&lt;br&gt;&lt;br&gt;一般建立Cookie的寫法為：&lt;/p&gt; &lt;div style=&quot;border-bottom: silver 1px solid; text-align: left; border-left: silver 1px solid; padding-bottom: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; padding-left: 4px; width: 97.5%; padding-right: 4px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; max-height: 200px; font-size: 8pt; overflow: auto; border-top: silver 1px solid; cursor: text; border-right: silver 1px solid; padding-top: 4px&quot; id=&quot;codeSnippetWrapper&quot;&gt; &lt;div style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot; id=&quot;codeSnippet&quot;&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #0000ff&quot;&gt;Dim&lt;/span&gt; cookie &lt;span style=&quot;color: #0000ff&quot;&gt;As&lt;/span&gt; &lt;span style=&quot;color: #0000ff&quot;&gt;New&lt;/span&gt; HttpCookie(&lt;span style=&quot;color: #006080&quot;&gt;&quot;UserInfo&quot;&lt;/span&gt;)&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot;&gt;cookie.Values.Add(&lt;span style=&quot;color: #006080&quot;&gt;&quot;Login&quot;&lt;/span&gt;, &lt;span style=&quot;color: #006080&quot;&gt;&quot;OK&quot;&lt;/span&gt;)&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot;&gt;cookie.Values.Add(&lt;span style=&quot;color: #006080&quot;&gt;&quot;No&quot;&lt;/span&gt;, dr(&lt;span style=&quot;color: #006080&quot;&gt;&quot;員工編號&quot;&lt;/span&gt;))&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot;&gt;cookie.Values.Add(&lt;span style=&quot;color: #006080&quot;&gt;&quot;Name&quot;&lt;/span&gt;, (dr(&lt;span style=&quot;color: #006080&quot;&gt;&quot;員工姓名&quot;&lt;/span&gt;))&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot;&gt;Response.Cookies.Add(cookie)&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;/div&gt;&lt;/div&gt;&lt;br /&gt;&lt;p&gt;&lt;br&gt;由於其中&quot;Name&quot;的Cookie內容存放的是中文字員工姓名，讀取時使用Request.Cookies(&quot;UserInfo&quot;)(&quot;Name&quot;)後，會發現讀到的中文已經變為亂碼。&lt;br&gt;&lt;br&gt;我們將原本的寫法加入&lt;strong&gt;&lt;a href=&quot;http://msdn.microsoft.com/zh-tw/library/4fkewx0t%28VS.80%29.aspx&quot; target=&quot;_blank&quot;&gt;HttpUtility.UrlEncode&lt;/a&gt;&lt;/strong&gt;(編碼)與&lt;a href=&quot;http://msdn.microsoft.com/zh-tw/library/system.web.httputility.urldecode%28VS.80%29.aspx&quot; target=&quot;_blank&quot;&gt;HttpUtility.UrlDecode&lt;/a&gt;&lt;strong&gt;&lt;/strong&gt;(解碼)，在URL中傳輸而進行編碼的字串轉換來解決亂碼的問題。修改後程式碼如下：&lt;br&gt;&lt;br&gt;建立Cookie時編碼：&lt;/p&gt;&lt;br /&gt;&lt;div style=&quot;border-bottom: silver 1px solid; text-align: left; border-left: silver 1px solid; padding-bottom: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; padding-left: 4px; width: 97.5%; padding-right: 4px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; max-height: 200px; font-size: 8pt; overflow: auto; border-top: silver 1px solid; cursor: text; border-right: silver 1px solid; padding-top: 4px&quot; id=&quot;codeSnippetWrapper&quot;&gt;&lt;br /&gt;&lt;div style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot; id=&quot;codeSnippet&quot;&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #0000ff&quot;&gt;Dim&lt;/span&gt; cookie &lt;span style=&quot;color: #0000ff&quot;&gt;As&lt;/span&gt; &lt;span style=&quot;color: #0000ff&quot;&gt;New&lt;/span&gt; HttpCookie(&lt;span style=&quot;color: #006080&quot;&gt;&quot;UserInfo&quot;&lt;/span&gt;)&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot;&gt;cookie.Values.Add(&lt;span style=&quot;color: #006080&quot;&gt;&quot;Login&quot;&lt;/span&gt;, &lt;span style=&quot;color: #006080&quot;&gt;&quot;OK&quot;&lt;/span&gt;)&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot;&gt;cookie.Values.Add(&lt;span style=&quot;color: #006080&quot;&gt;&quot;No&quot;&lt;/span&gt;, dr(&lt;span style=&quot;color: #006080&quot;&gt;&quot;員工編號&quot;&lt;/span&gt;))&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot;&gt;cookie.Values.Add(&lt;span style=&quot;color: #006080&quot;&gt;&quot;Name&quot;&lt;/span&gt;, HttpUtility.UrlEncode(dr(&lt;span style=&quot;color: #006080&quot;&gt;&quot;員工姓名&quot;&lt;/span&gt;)))&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot;&gt;Response.Cookies.Add(cookie)&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;/div&gt;&lt;/div&gt;&lt;br /&gt;&lt;p&gt;&lt;br&gt;讀取時解碼：&lt;br&gt;HttpUtility.UrlDecode(Request.Cookies(&quot;UserInfo&quot;)(&quot;Name&quot;))&lt;/p&gt;  </content><link rel='replies' type='application/atom+xml' href='http://tgw1029.blogspot.com/feeds/2677783701141349398/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://tgw1029.blogspot.com/2010/04/aspnet-cookie.html#comment-form' title='1 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2893139382062216061/posts/default/2677783701141349398'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2893139382062216061/posts/default/2677783701141349398'/><link rel='alternate' type='text/html' href='http://tgw1029.blogspot.com/2010/04/aspnet-cookie.html' title='Asp.Net -Cookie讀取中文變亂碼的解決方法'/><author><name>威筆記</name><uri>http://www.blogger.com/profile/03781053564980189303</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2893139382062216061.post-7930205537267512364</id><published>2010-04-03T15:34:00.001+08:00</published><updated>2010-04-03T15:48:10.564+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Asp.Net"/><title type='text'>伺服器 &#39;Localhost\SQLEXPRESS&#39; 上的 MSDTC 無法使用。</title><content type='html'>&lt;p&gt;&lt;font color=&quot;#000000&quot;&gt;若在操作Asp.Net網站時發生『&lt;/font&gt;&lt;strong&gt;&lt;font color=&quot;#ff0000&quot;&gt;伺服器 &#39;Localhost\SQLEXPRESS&#39; 上的 MSDTC 無法使用。&lt;/strong&gt;&lt;/font&gt;&lt;font color=&quot;#000000&quot;&gt;』的錯誤訊息，那麼一定是在進行資料庫存取時使用了&lt;/font&gt;&lt;a href=&quot;http://msdn.microsoft.com/zh-tw/library/system.transactions.transactionscope%28VS.80%29.aspx&quot; target=&quot;_blank&quot;&gt;&lt;font color=&quot;#535353&quot;&gt;&lt;font color=&quot;#ff0000&quot;&gt;TransactionScope&lt;/a&gt;&lt;font color=&quot;#000000&quot;&gt;的交易機制來確保交易的完整性。&lt;/font&gt;&lt;br&gt;&lt;br&gt;&lt;font color=&quot;#000000&quot;&gt;在程式碼中加入TransactionScope交易機制的同時，也需要在網站Server上開啟&lt;/font&gt;&lt;a href=&quot;http://en.wikipedia.org/wiki/Distributed_Transaction_Coordinator&quot; target=&quot;_blank&quot;&gt;MSDTC&lt;/a&gt;&lt;/font&gt;&lt;/font&gt;&lt;font color=&quot;#000000&quot;&gt;(Microsoft Distributed Transaction Coordination)分散式異動交易的系統服務，否則就會看到『伺服器 &#39;Localhost\SQLEXPRESS&#39; 上的 MSDTC 無法使用。』的錯誤訊息。由於MSDTC在XP系統中預設是不開啟，因此我們需要將其開啟並設為自動開啟。&lt;br&gt;&lt;/font&gt;&lt;font color=&quot;#ff0000&quot;&gt;&lt;font color=&quot;#000000&quot;&gt;&lt;br&gt;&lt;font color=&quot;#0000ff&quot;&gt;&lt;strong&gt;開啟MSDTC方法&lt;/strong&gt;&lt;/font&gt;&lt;/font&gt;&lt;font color=&quot;#000000&quot;&gt;：(以XP為例)&lt;br&gt;[控制台]→[系統管理工具]→[服務]&lt;br&gt;找到『&lt;strong&gt;Distributed Transaction Coordinator&lt;/strong&gt;』的服務名稱&lt;br&gt;&lt;a href=&quot;http://lh3.ggpht.com/_2sQfBxJU9mI/S7bviULrG-I/AAAAAAAAMBI/FpGUJ8Vr9Yg/s1600-h/2010-04-03_152712%5B4%5D.jpg&quot;&gt;&lt;img style=&quot;border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px&quot; title=&quot;2010-04-03_152712&quot; border=&quot;0&quot; alt=&quot;2010-04-03_152712&quot; src=&quot;http://lh5.ggpht.com/_2sQfBxJU9mI/S7bvjzuDpvI/AAAAAAAAMBM/ZSY9X3E-OK8/2010-04-03_152712_thumb%5B2%5D.jpg?imgmax=800&quot; width=&quot;504&quot; height=&quot;192&quot;&gt;&lt;/a&gt; &lt;br&gt;在其名稱上按[右鍵]→[內容]&lt;br&gt;&lt;a href=&quot;http://lh4.ggpht.com/_2sQfBxJU9mI/S7bvk8o-M4I/AAAAAAAAMBQ/YNnlyOj4ANw/s1600-h/2010-04-03_152846%5B3%5D.jpg&quot;&gt;&lt;img style=&quot;border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px&quot; title=&quot;2010-04-03_152846&quot; border=&quot;0&quot; alt=&quot;2010-04-03_152846&quot; src=&quot;http://lh6.ggpht.com/_2sQfBxJU9mI/S7bvl69c0_I/AAAAAAAAMBU/Z-9vajdRXys/2010-04-03_152846_thumb%5B1%5D.jpg?imgmax=800&quot; width=&quot;487&quot; height=&quot;243&quot;&gt;&lt;/a&gt; &lt;/font&gt;&lt;/font&gt;&lt;/p&gt; &lt;p&gt;&lt;/p&gt; &lt;p&gt;&lt;br&gt;進入內容後如下圖將&lt;strong&gt;啟動類型&lt;/strong&gt;改為&lt;font color=&quot;#ff0000&quot;&gt;自動&lt;/font&gt;、&lt;strong&gt;服務狀態&lt;/strong&gt;將其&lt;font color=&quot;#ff0000&quot;&gt;啟動&lt;/font&gt;。&lt;br&gt;&lt;a href=&quot;http://lh3.ggpht.com/_2sQfBxJU9mI/S7bvmyANaQI/AAAAAAAAMBY/qA5RoLmqrDw/s1600-h/2010-04-03_152945%5B5%5D.jpg&quot;&gt;&lt;img style=&quot;border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px&quot; title=&quot;2010-04-03_152945&quot; border=&quot;0&quot; alt=&quot;2010-04-03_152945&quot; src=&quot;http://lh4.ggpht.com/_2sQfBxJU9mI/S7bvofsYnZI/AAAAAAAAMBc/dJB31IdTgrw/2010-04-03_152945_thumb%5B3%5D.jpg?imgmax=800&quot; width=&quot;404&quot; height=&quot;450&quot;&gt;&lt;/a&gt; &lt;/p&gt; &lt;p&gt;&lt;br&gt;完成設定後，Asp.Net網站即可正確的執行TransactionScope交易機制。&lt;/p&gt;  </content><link rel='replies' type='application/atom+xml' href='http://tgw1029.blogspot.com/feeds/7930205537267512364/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://tgw1029.blogspot.com/2010/04/msdtc.html#comment-form' title='1 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2893139382062216061/posts/default/7930205537267512364'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2893139382062216061/posts/default/7930205537267512364'/><link rel='alternate' type='text/html' href='http://tgw1029.blogspot.com/2010/04/msdtc.html' title='伺服器 &amp;#39;Localhost\SQLEXPRESS&amp;#39; 上的 MSDTC 無法使用。'/><author><name>威筆記</name><uri>http://www.blogger.com/profile/03781053564980189303</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://lh5.ggpht.com/_2sQfBxJU9mI/S7bvjzuDpvI/AAAAAAAAMBM/ZSY9X3E-OK8/s72-c/2010-04-03_152712_thumb%5B2%5D.jpg?imgmax=800" height="72" width="72"/><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2893139382062216061.post-998715372834538636</id><published>2010-04-03T14:55:00.001+08:00</published><updated>2010-04-03T14:56:40.127+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Asp.Net"/><title type='text'>GridView隱藏欄位(Visible=&quot;Flase&quot;)後取不到值的替代方法</title><content type='html'>&lt;p&gt;有時我們需要在GridView中設置欄位來取值，以作為後續動作的資料來源判斷依據，但又不想在使用者瀏覽時顯示此欄位。例：GridView中使用BoundField 來取得存檔日期的值同時將其欄位設為不顯示&lt;em&gt;，&amp;lt;asp:BoundField DataField=&quot;存檔日期&quot; Visible=&quot;false&quot; /&amp;gt;&lt;/em&gt;。這時在GridView的RowDataBound事件中使用e.Row.Cells(0).Text的方式取值會發現無法順利取到值。 &lt;br&gt;&lt;br&gt;因此需要使用另一種替代方式來達到此目的的實現，在Asp.Net中有個專為隱藏數值設計的控制項&lt;strong&gt;HiddenField&lt;/strong&gt;，我們要作的就是將原本&lt;em&gt;&amp;lt;asp:BoundField DataField=&quot;存檔日期&quot; Visible=&quot;false&quot; /&amp;gt;&lt;/em&gt;的資料繫結方式改為使用HiddenField的Value值與存檔日期繫結，並將此HiddenField控制項置於GridView的&lt;strong&gt;TemplateField&lt;/strong&gt;中。&lt;/p&gt; &lt;div style=&quot;border-bottom: silver 1px solid; text-align: left; border-left: silver 1px solid; padding-bottom: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; padding-left: 4px; width: 97.5%; padding-right: 4px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; max-height: 200px; font-size: 8pt; overflow: auto; border-top: silver 1px solid; cursor: text; border-right: silver 1px solid; padding-top: 4px&quot; id=&quot;codeSnippetWrapper&quot;&gt; &lt;div style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot; id=&quot;codeSnippet&quot;&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot;&gt;&amp;lt;asp:TemplateField&amp;gt;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot;&gt;    &amp;lt;ItemTemplate&amp;gt;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot;&gt;        &amp;lt;asp:HiddenField ID=&lt;span style=&quot;color: #006080&quot;&gt;&quot;SaveTime&quot;&lt;/span&gt; runat=&lt;span style=&quot;color: #006080&quot;&gt;&quot;server&quot;&lt;/span&gt; Value=&lt;span style=&quot;color: #008000&quot;&gt;&#39;&amp;lt;%# Eval(&quot;存檔日期&quot;) %&amp;gt;&#39; /&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot;&gt;    &amp;lt;/ItemTemplate&amp;gt;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot;&gt;&amp;lt;/asp:TemplateField&amp;gt;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;/div&gt;&lt;/div&gt;&lt;br /&gt;&lt;p&gt;&lt;br&gt;如此便可在GridView的RowDataBound事件中使用&lt;strong&gt;FindControl&lt;/strong&gt;的方式來取得GridView各個欄位中的存檔日期值。&lt;/p&gt;&lt;br /&gt;&lt;div style=&quot;border-bottom: silver 1px solid; text-align: left; border-left: silver 1px solid; padding-bottom: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; padding-left: 4px; width: 97.5%; padding-right: 4px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; max-height: 200px; font-size: 8pt; overflow: auto; border-top: silver 1px solid; cursor: text; border-right: silver 1px solid; padding-top: 4px&quot; id=&quot;codeSnippetWrapper&quot;&gt;&lt;br /&gt;&lt;div style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot; id=&quot;codeSnippet&quot;&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #0000ff&quot;&gt;Protected&lt;/span&gt; &lt;span style=&quot;color: #0000ff&quot;&gt;Sub&lt;/span&gt; GridView_RowDataBound(&lt;span style=&quot;color: #0000ff&quot;&gt;ByVal&lt;/span&gt; sender &lt;span style=&quot;color: #0000ff&quot;&gt;As&lt;/span&gt; &lt;span style=&quot;color: #0000ff&quot;&gt;Object&lt;/span&gt;, &lt;span style=&quot;color: #0000ff&quot;&gt;ByVal&lt;/span&gt; e &lt;span style=&quot;color: #0000ff&quot;&gt;As&lt;/span&gt; System.Web.UI.WebControls.GridViewRowEventArgs) &lt;span style=&quot;color: #0000ff&quot;&gt;Handles&lt;/span&gt; GridView.RowDataBound&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot;&gt;    &lt;span style=&quot;color: #0000ff&quot;&gt;If&lt;/span&gt; e.Row.RowType = DataControlRowType.DataRow &lt;span style=&quot;color: #0000ff&quot;&gt;Then&lt;/span&gt;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot;&gt;        Response.Write(&lt;span style=&quot;color: #0000ff&quot;&gt;CType&lt;/span&gt;(e.Row.FindControl(&lt;span style=&quot;color: #006080&quot;&gt;&quot;SaveTime&quot;&lt;/span&gt;), HiddenField).Value)&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot;&gt;    &lt;span style=&quot;color: #0000ff&quot;&gt;End&lt;/span&gt; &lt;span style=&quot;color: #0000ff&quot;&gt;If&lt;/span&gt;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #0000ff&quot;&gt;End&lt;/span&gt; Sub&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;/div&gt;&lt;/div&gt;  </content><link rel='replies' type='application/atom+xml' href='http://tgw1029.blogspot.com/feeds/998715372834538636/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://tgw1029.blogspot.com/2010/04/gridviewvisible.html#comment-form' title='1 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2893139382062216061/posts/default/998715372834538636'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2893139382062216061/posts/default/998715372834538636'/><link rel='alternate' type='text/html' href='http://tgw1029.blogspot.com/2010/04/gridviewvisible.html' title='GridView隱藏欄位(Visible=&amp;quot;Flase&amp;quot;)後取不到值的替代方法'/><author><name>威筆記</name><uri>http://www.blogger.com/profile/03781053564980189303</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2893139382062216061.post-197170887349428474</id><published>2010-04-03T11:17:00.002+08:00</published><updated>2010-04-27T11:58:11.264+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Asp.Net"/><title type='text'>DataList包DataList中建立子DataList的ItemCommand事件</title><content type='html'>DataList包DataList此種用法最常見的如部落格文章的回應功能。頁面中使用DataList來Show出多筆文章，文章的DataList中再套入Datalist來顯示多筆回應內容。如此形成兩層DataList的情況後，我們在實作時首先會發現在Vistual Studio中找不到子DataList的事件選項供自己選擇。&lt;br /&gt;&lt;br /&gt;遇到此種情況便需要我們自己來手動建立子DataList事件了。在網路上你可以找到不只一種建立子DataList的方法，在此我將個人認為最簡單的建立事件方法記錄如下。&lt;br /&gt;&lt;br /&gt;&lt;b&gt;&lt;span style=&quot;color: blue;&quot;&gt;方法：&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;手動建立&lt;b&gt;Public Sub&lt;/b&gt;後，在子DataList中指定&lt;b&gt;OnItemCommand&lt;/b&gt;事件並觸發Public Sub。我們需要作的事是在DataList2中手動輸入&lt;b&gt;OnItemCommand=&quot; Plublic Sub事件名稱 &quot;&lt;/b&gt; (如程式第10行)。&lt;br /&gt;&lt;br /&gt;Test.aspx&lt;br /&gt;&lt;div id=&quot;codeSnippetWrapper&quot; style=&quot;background-color: #f4f4f4; border: 1px solid silver; cursor: text; direction: ltr; font-family: &#39;Courier New&#39;,courier,monospace; font-size: 8pt; line-height: 12pt; margin: 20px 0px 10px; max-height: 200px; overflow: auto; padding: 4px; text-align: left; width: 97.5%;&quot;&gt;&lt;div id=&quot;codeSnippet&quot; style=&quot;background-color: #f4f4f4; border-style: none; color: black; direction: ltr; font-family: &#39;Courier New&#39;,courier,monospace; font-size: 8pt; line-height: 12pt; overflow: visible; padding: 0px; text-align: left; width: 100%;&quot;&gt;&lt;pre style=&quot;background-color: white; border-style: none; color: black; direction: ltr; font-family: &#39;Courier New&#39;,courier,monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding: 0px; text-align: left; width: 100%;&quot;&gt;&lt;span id=&quot;lnum1&quot; style=&quot;color: #606060;&quot;&gt;   1:&lt;/span&gt; &lt;span style=&quot;color: blue;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: maroon;&quot;&gt;asp:DataList&lt;/span&gt; &lt;span style=&quot;color: red;&quot;&gt;ID&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;=&quot;DataList1&quot;&lt;/span&gt; &lt;span style=&quot;color: red;&quot;&gt;runat&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;=&quot;server&quot;&lt;/span&gt; &lt;span style=&quot;color: red;&quot;&gt;DataKeyField&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;=&quot;拜訪編號&quot;&lt;/span&gt; &lt;/pre&gt;&lt;pre style=&quot;background-color: #f4f4f4; border-style: none; color: black; direction: ltr; font-family: &#39;Courier New&#39;,courier,monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding: 0px; text-align: left; width: 100%;&quot;&gt;&lt;span id=&quot;lnum2&quot; style=&quot;color: #606060;&quot;&gt;   2:&lt;/span&gt;     &lt;span style=&quot;color: red;&quot;&gt;DataSourceID&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;=&quot;SqlDataSource1&quot;&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre style=&quot;background-color: white; border-style: none; color: black; direction: ltr; font-family: &#39;Courier New&#39;,courier,monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding: 0px; text-align: left; width: 100%;&quot;&gt;&lt;span id=&quot;lnum3&quot; style=&quot;color: #606060;&quot;&gt;   3:&lt;/span&gt;     &lt;span style=&quot;color: blue;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: maroon;&quot;&gt;ItemTemplate&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre style=&quot;background-color: #f4f4f4; border-style: none; color: black; direction: ltr; font-family: &#39;Courier New&#39;,courier,monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding: 0px; text-align: left; width: 100%;&quot;&gt;&lt;span id=&quot;lnum4&quot; style=&quot;color: #606060;&quot;&gt;   4:&lt;/span&gt;         &lt;span style=&quot;color: blue;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: maroon;&quot;&gt;font&lt;/span&gt; &lt;span style=&quot;color: red;&quot;&gt;color&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;=&quot;red&quot;&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre style=&quot;background-color: white; border-style: none; color: black; direction: ltr; font-family: &#39;Courier New&#39;,courier,monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding: 0px; text-align: left; width: 100%;&quot;&gt;&lt;span id=&quot;lnum5&quot; style=&quot;color: #606060;&quot;&gt;   5:&lt;/span&gt;             拜訪編號:&lt;/pre&gt;&lt;pre style=&quot;background-color: #f4f4f4; border-style: none; color: black; direction: ltr; font-family: &#39;Courier New&#39;,courier,monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding: 0px; text-align: left; width: 100%;&quot;&gt;&lt;span id=&quot;lnum6&quot; style=&quot;color: #606060;&quot;&gt;   6:&lt;/span&gt;             &lt;span style=&quot;color: blue;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: maroon;&quot;&gt;asp:Label&lt;/span&gt; &lt;span style=&quot;color: red;&quot;&gt;ID&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;=&quot;拜訪編號Label&quot;&lt;/span&gt; &lt;span style=&quot;color: red;&quot;&gt;runat&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;=&quot;server&quot;&lt;/span&gt; &lt;span style=&quot;color: red;&quot;&gt;Text&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;=&#39;&amp;lt;%# Eval(&quot;拜訪編號&quot;) %&amp;gt;&#39;&lt;/span&gt; &lt;span style=&quot;color: blue;&quot;&gt;/&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre style=&quot;background-color: white; border-style: none; color: black; direction: ltr; font-family: &#39;Courier New&#39;,courier,monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding: 0px; text-align: left; width: 100%;&quot;&gt;&lt;span id=&quot;lnum7&quot; style=&quot;color: #606060;&quot;&gt;   7:&lt;/span&gt;             &lt;span style=&quot;color: blue;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: maroon;&quot;&gt;asp:Button&lt;/span&gt; &lt;span style=&quot;color: red;&quot;&gt;ID&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;=&quot;Button1&quot;&lt;/span&gt; &lt;span style=&quot;color: red;&quot;&gt;runat&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;=&quot;server&quot;&lt;/span&gt; &lt;span style=&quot;color: red;&quot;&gt;Text&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;=&quot;按鈕1&quot;&lt;/span&gt; &lt;span style=&quot;color: red;&quot;&gt;CommandName&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;=&quot;TestButton&quot;&lt;/span&gt; &lt;span style=&quot;color: blue;&quot;&gt;/&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre style=&quot;background-color: #f4f4f4; border-style: none; color: black; direction: ltr; font-family: &#39;Courier New&#39;,courier,monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding: 0px; text-align: left; width: 100%;&quot;&gt;&lt;span id=&quot;lnum8&quot; style=&quot;color: #606060;&quot;&gt;   8:&lt;/span&gt;         &lt;span style=&quot;color: blue;&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span style=&quot;color: maroon;&quot;&gt;font&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre style=&quot;background-color: white; border-style: none; color: black; direction: ltr; font-family: &#39;Courier New&#39;,courier,monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding: 0px; text-align: left; width: 100%;&quot;&gt;&lt;span id=&quot;lnum9&quot; style=&quot;color: #606060;&quot;&gt;   9:&lt;/span&gt;         &lt;span style=&quot;color: blue;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: maroon;&quot;&gt;asp:DataList&lt;/span&gt; &lt;span style=&quot;color: red;&quot;&gt;ID&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;=&quot;DataList2&quot;&lt;/span&gt; &lt;span style=&quot;color: red;&quot;&gt;runat&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;=&quot;server&quot;&lt;/span&gt; &lt;/pre&gt;&lt;pre style=&quot;background-color: #f4f4f4; border-style: none; color: black; direction: ltr; font-family: &#39;Courier New&#39;,courier,monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding: 0px; text-align: left; width: 100%;&quot;&gt;&lt;span id=&quot;lnum10&quot; style=&quot;color: #606060;&quot;&gt;  10:&lt;/span&gt;         &lt;span style=&quot;color: red;&quot;&gt;DataSourceID&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;=&quot;SqlDataSource2&quot;&lt;/span&gt; &lt;span style=&quot;color: red;&quot;&gt;OnItemCommand&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;=&quot;DataList2_ItemCommand&quot;&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre style=&quot;background-color: white; border-style: none; color: black; direction: ltr; font-family: &#39;Courier New&#39;,courier,monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding: 0px; text-align: left; width: 100%;&quot;&gt;&lt;span id=&quot;lnum11&quot; style=&quot;color: #606060;&quot;&gt;  11:&lt;/span&gt;         &lt;span style=&quot;color: blue;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: maroon;&quot;&gt;ItemTemplate&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre style=&quot;background-color: #f4f4f4; border-style: none; color: black; direction: ltr; font-family: &#39;Courier New&#39;,courier,monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding: 0px; text-align: left; width: 100%;&quot;&gt;&lt;span id=&quot;lnum12&quot; style=&quot;color: #606060;&quot;&gt;  12:&lt;/span&gt;             拜訪目的:&lt;/pre&gt;&lt;pre style=&quot;background-color: white; border-style: none; color: black; direction: ltr; font-family: &#39;Courier New&#39;,courier,monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding: 0px; text-align: left; width: 100%;&quot;&gt;&lt;span id=&quot;lnum13&quot; style=&quot;color: #606060;&quot;&gt;  13:&lt;/span&gt;             &lt;span style=&quot;color: blue;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: maroon;&quot;&gt;asp:Label&lt;/span&gt; &lt;span style=&quot;color: red;&quot;&gt;ID&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;=&quot;拜訪目的Label&quot;&lt;/span&gt; &lt;span style=&quot;color: red;&quot;&gt;runat&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;=&quot;server&quot;&lt;/span&gt; &lt;span style=&quot;color: red;&quot;&gt;Text&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;=&#39;&amp;lt;%# Eval(&quot;拜訪目的&quot;) %&amp;gt;&#39;&lt;/span&gt; &lt;span style=&quot;color: blue;&quot;&gt;/&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre style=&quot;background-color: #f4f4f4; border-style: none; color: black; direction: ltr; font-family: &#39;Courier New&#39;,courier,monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding: 0px; text-align: left; width: 100%;&quot;&gt;&lt;span id=&quot;lnum14&quot; style=&quot;color: #606060;&quot;&gt;  14:&lt;/span&gt;             &lt;span style=&quot;color: blue;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: maroon;&quot;&gt;asp:Button&lt;/span&gt; &lt;span style=&quot;color: red;&quot;&gt;ID&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;=&quot;Button1&quot;&lt;/span&gt; &lt;span style=&quot;color: red;&quot;&gt;runat&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;=&quot;server&quot;&lt;/span&gt; &lt;span style=&quot;color: red;&quot;&gt;Text&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;=&quot;按鈕2&quot;&lt;/span&gt; &lt;span style=&quot;color: red;&quot;&gt;CommandName&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;=&quot;TestButton2&quot;&lt;/span&gt; &lt;span style=&quot;color: blue;&quot;&gt;/&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre style=&quot;background-color: white; border-style: none; color: black; direction: ltr; font-family: &#39;Courier New&#39;,courier,monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding: 0px; text-align: left; width: 100%;&quot;&gt;&lt;span id=&quot;lnum15&quot; style=&quot;color: #606060;&quot;&gt;  15:&lt;/span&gt;         &lt;span style=&quot;color: blue;&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span style=&quot;color: maroon;&quot;&gt;ItemTemplate&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre style=&quot;background-color: #f4f4f4; border-style: none; color: black; direction: ltr; font-family: &#39;Courier New&#39;,courier,monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding: 0px; text-align: left; width: 100%;&quot;&gt;&lt;span id=&quot;lnum16&quot; style=&quot;color: #606060;&quot;&gt;  16:&lt;/span&gt;         &lt;span style=&quot;color: blue;&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span style=&quot;color: maroon;&quot;&gt;asp:DataList&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre style=&quot;background-color: white; border-style: none; color: black; direction: ltr; font-family: &#39;Courier New&#39;,courier,monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding: 0px; text-align: left; width: 100%;&quot;&gt;&lt;span id=&quot;lnum17&quot; style=&quot;color: #606060;&quot;&gt;  17:&lt;/span&gt;         &lt;span style=&quot;color: blue;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: maroon;&quot;&gt;br&lt;/span&gt; &lt;span style=&quot;color: blue;&quot;&gt;/&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre style=&quot;background-color: #f4f4f4; border-style: none; color: black; direction: ltr; font-family: &#39;Courier New&#39;,courier,monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding: 0px; text-align: left; width: 100%;&quot;&gt;&lt;span id=&quot;lnum18&quot; style=&quot;color: #606060;&quot;&gt;  18:&lt;/span&gt;     &lt;span style=&quot;color: blue;&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span style=&quot;color: maroon;&quot;&gt;ItemTemplate&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre style=&quot;background-color: white; border-style: none; color: black; direction: ltr; font-family: &#39;Courier New&#39;,courier,monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding: 0px; text-align: left; width: 100%;&quot;&gt;&lt;span id=&quot;lnum19&quot; style=&quot;color: #606060;&quot;&gt;  19:&lt;/span&gt; &lt;span style=&quot;color: blue;&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span style=&quot;color: maroon;&quot;&gt;asp:DataList&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;br /&gt;在Test.aspx.vb中建立Public Sub，其名稱為&lt;b&gt;OnItemCommand&lt;/b&gt;事件指定呼叫的名稱。&lt;br /&gt;&lt;br /&gt;Test.aspx.vb&lt;br /&gt;&lt;br /&gt;&lt;div id=&quot;codeSnippetWrapper&quot; style=&quot;background-color: #f4f4f4; border: 1px solid silver; cursor: text; direction: ltr; font-family: &#39;Courier New&#39;,courier,monospace; font-size: 8pt; line-height: 12pt; margin: 20px 0px 10px; max-height: 200px; overflow: auto; padding: 4px; text-align: left; width: 97.5%;&quot;&gt;&lt;br /&gt;&lt;div id=&quot;codeSnippet&quot; style=&quot;background-color: #f4f4f4; border-style: none; color: black; direction: ltr; font-family: &#39;Courier New&#39;,courier,monospace; font-size: 8pt; line-height: 12pt; overflow: visible; padding: 0px; text-align: left; width: 100%;&quot;&gt;&lt;pre style=&quot;background-color: white; border-style: none; color: black; direction: ltr; font-family: &#39;Courier New&#39;,courier,monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding: 0px; text-align: left; width: 100%;&quot;&gt;&lt;span id=&quot;lnum1&quot; style=&quot;color: #606060;&quot;&gt;   1:&lt;/span&gt; &lt;span style=&quot;color: blue;&quot;&gt;Public&lt;/span&gt; &lt;span style=&quot;color: blue;&quot;&gt;Sub&lt;/span&gt; DataList2_ItemCommand(&lt;span style=&quot;color: blue;&quot;&gt;ByVal&lt;/span&gt; source &lt;span style=&quot;color: blue;&quot;&gt;As&lt;/span&gt; &lt;span style=&quot;color: blue;&quot;&gt;Object&lt;/span&gt;, &lt;span style=&quot;color: blue;&quot;&gt;ByVal&lt;/span&gt; e &lt;span style=&quot;color: blue;&quot;&gt;As&lt;/span&gt; System.Web.UI.WebControls.DataListCommandEventArgs)&lt;/pre&gt;&lt;pre style=&quot;background-color: #f4f4f4; border-style: none; color: black; direction: ltr; font-family: &#39;Courier New&#39;,courier,monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding: 0px; text-align: left; width: 100%;&quot;&gt;&lt;span id=&quot;lnum2&quot; style=&quot;color: #606060;&quot;&gt;   2:&lt;/span&gt;     &lt;span style=&quot;color: blue;&quot;&gt;If&lt;/span&gt; e.CommandName = &lt;span style=&quot;color: #006080;&quot;&gt;&quot;TestButton2&quot;&lt;/span&gt; &lt;span style=&quot;color: blue;&quot;&gt;Then&lt;/span&gt;&lt;/pre&gt;&lt;pre style=&quot;background-color: white; border-style: none; color: black; direction: ltr; font-family: &#39;Courier New&#39;,courier,monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding: 0px; text-align: left; width: 100%;&quot;&gt;&lt;span id=&quot;lnum3&quot; style=&quot;color: #606060;&quot;&gt;   3:&lt;/span&gt;         Response.Write(&lt;span style=&quot;color: #006080;&quot;&gt;&quot;This is DataList2&quot;&lt;/span&gt;)&lt;/pre&gt;&lt;pre style=&quot;background-color: #f4f4f4; border-style: none; color: black; direction: ltr; font-family: &#39;Courier New&#39;,courier,monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding: 0px; text-align: left; width: 100%;&quot;&gt;&lt;span id=&quot;lnum4&quot; style=&quot;color: #606060;&quot;&gt;   4:&lt;/span&gt;     &lt;span style=&quot;color: blue;&quot;&gt;End&lt;/span&gt; &lt;span style=&quot;color: blue;&quot;&gt;If&lt;/span&gt;&lt;/pre&gt;&lt;pre style=&quot;background-color: white; border-style: none; color: black; direction: ltr; font-family: &#39;Courier New&#39;,courier,monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding: 0px; text-align: left; width: 100%;&quot;&gt;&lt;span id=&quot;lnum5&quot; style=&quot;color: #606060;&quot;&gt;   5:&lt;/span&gt; &lt;span style=&quot;color: blue;&quot;&gt;End&lt;/span&gt; Sub&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;br /&gt;在我們按下&lt;b&gt;按鈕2&lt;/b&gt;後便可以正確觸發子DataList的I&lt;b&gt;temCommand&lt;/b&gt;事件&lt;b&gt;：&lt;br /&gt;&lt;a href=&quot;http://lh3.ggpht.com/_2sQfBxJU9mI/S7azRTYLgZI/AAAAAAAAMBA/bFYB64f-emw/s1600-h/2010-04-03_105109%5B6%5D.jpg&quot;&gt;&lt;img alt=&quot;2010-04-03_105109&quot; border=&quot;0&quot; height=&quot;231&quot; src=&quot;http://lh6.ggpht.com/_2sQfBxJU9mI/S7azSFTD_XI/AAAAAAAAMBE/RQ_v5DP5wAw/2010-04-03_105109_thumb%5B2%5D.jpg?imgmax=800&quot; style=&quot;border: 0px none; display: inline;&quot; title=&quot;2010-04-03_105109&quot; width=&quot;241&quot; /&gt;&lt;/a&gt;&lt;/b&gt;</content><link rel='replies' type='application/atom+xml' href='http://tgw1029.blogspot.com/feeds/197170887349428474/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://tgw1029.blogspot.com/2010/04/datalistdatalistdatalistitemcommand.html#comment-form' title='2 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2893139382062216061/posts/default/197170887349428474'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2893139382062216061/posts/default/197170887349428474'/><link rel='alternate' type='text/html' href='http://tgw1029.blogspot.com/2010/04/datalistdatalistdatalistitemcommand.html' title='DataList包DataList中建立子DataList的ItemCommand事件'/><author><name>威筆記</name><uri>http://www.blogger.com/profile/03781053564980189303</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://lh6.ggpht.com/_2sQfBxJU9mI/S7azSFTD_XI/AAAAAAAAMBE/RQ_v5DP5wAw/s72-c/2010-04-03_105109_thumb%5B2%5D.jpg?imgmax=800" height="72" width="72"/><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2893139382062216061.post-6452893686142039906</id><published>2010-03-20T15:16:00.001+08:00</published><updated>2010-03-20T15:18:10.273+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Asp.Net"/><title type='text'>Asp.Net的錨點(#連結)功能，支援FireFox</title><content type='html'>&lt;p&gt;所謂錨點(#連結)的作法為超連結網址後方加上#參數。最常見的應用為指定回應內容網址的功能，讓使用者點擊回應連結後可直接將瀏覽器畫面定位在頁面下方的回應內容位置。&lt;br&gt;&lt;br&gt;錨點#的用法如下：&lt;br&gt;Ex：&lt;a href=&quot;http://localhost/Test/Test.aspx#Link&quot;&gt;http://localhost/Test/Test.aspx#Link&lt;/a&gt;&lt;br&gt;如此我們就可以在被連結頁面中指定其連結位置&lt;br&gt;Ex：&lt;font color=&quot;#ff0000&quot;&gt;&lt;strong&gt;&amp;lt;a id=&quot;Link&quot;&amp;gt;&amp;lt;/a&amp;gt;&lt;br&gt;&lt;br&gt;&lt;/strong&gt;&lt;font color=&quot;#000000&quot;&gt;上面這種寫法支持xhtml網頁標準，與傳統的錨點寫法&amp;lt;a name=&quot;#Link&quot;&amp;gt;&amp;lt;/a&amp;gt;不同的是不使用name來指定錨點改用id指定且去掉了加上#字號。使用name一來會多了無意義的&amp;lt;a&amp;gt;連結，且未指定href也不符合xhtml標準，而使用id指定錨點不侷限於&amp;lt;a&amp;gt;標籤，可用於其它如&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;&amp;lt;h1&amp;gt;&amp;lt;li&amp;gt;等標籤中。&lt;strong&gt;最重要的是使用id指定錨點才能讓Firefox、Opera、Chorm等瀏覽器作用！不再是IE Only的功能了。&lt;br&gt;&lt;/strong&gt;&lt;/font&gt;&lt;br&gt;&lt;/font&gt;&lt;font color=&quot;#000000&quot;&gt;下面用個簡單的連結範例來實作錨點功能：&lt;br&gt;在Test.aspx頁面建立HyperLink控制項，並指定其超連結網址為Test2.aspx，同時加上錨點參數#Link&lt;/font&gt;&lt;/p&gt; &lt;div style=&quot;border-bottom: silver 1px solid; text-align: left; border-left: silver 1px solid; padding-bottom: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; padding-left: 4px; width: 97.5%; padding-right: 4px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; max-height: 200px; font-size: 8pt; overflow: auto; border-top: silver 1px solid; cursor: text; border-right: silver 1px solid; padding-top: 4px&quot; id=&quot;codeSnippetWrapper&quot;&gt; &lt;div style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot; id=&quot;codeSnippet&quot;&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;background-color: #ffff00&quot;&gt;&amp;lt;%@ Page Language=&quot;VB&quot; AutoEventWireup=&quot;false&quot; CodeFile=&quot;Test.aspx.vb&quot; Inherits=&quot;Test&quot; %&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot;&gt;&amp;nbsp;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #0000ff&quot;&gt;&amp;lt;!&lt;/span&gt;&lt;span style=&quot;color: #800000&quot;&gt;DOCTYPE&lt;/span&gt; &lt;span style=&quot;color: #ff0000&quot;&gt;html&lt;/span&gt; &lt;span style=&quot;color: #ff0000&quot;&gt;PUBLIC&lt;/span&gt; &lt;span style=&quot;color: #0000ff&quot;&gt;&quot;-//W3C//DTD XHTML 1.0 Transitional//EN&quot;&lt;/span&gt; &lt;span style=&quot;color: #0000ff&quot;&gt;&quot;http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd&quot;&lt;/span&gt;&lt;span style=&quot;color: #0000ff&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot;&gt;&amp;nbsp;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #0000ff&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #800000&quot;&gt;html&lt;/span&gt; &lt;span style=&quot;color: #ff0000&quot;&gt;xmlns&lt;/span&gt;&lt;span style=&quot;color: #0000ff&quot;&gt;=&quot;http://www.w3.org/1999/xhtml&quot;&lt;/span&gt;&lt;span style=&quot;color: #0000ff&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #0000ff&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #800000&quot;&gt;head&lt;/span&gt; &lt;span style=&quot;color: #ff0000&quot;&gt;runat&lt;/span&gt;&lt;span style=&quot;color: #0000ff&quot;&gt;=&quot;server&quot;&lt;/span&gt;&lt;span style=&quot;color: #0000ff&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot;&gt;    &lt;span style=&quot;color: #0000ff&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #800000&quot;&gt;title&lt;/span&gt;&lt;span style=&quot;color: #0000ff&quot;&gt;&amp;gt;&amp;lt;/&lt;/span&gt;&lt;span style=&quot;color: #800000&quot;&gt;title&lt;/span&gt;&lt;span style=&quot;color: #0000ff&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #0000ff&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span style=&quot;color: #800000&quot;&gt;head&lt;/span&gt;&lt;span style=&quot;color: #0000ff&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #0000ff&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #800000&quot;&gt;body&lt;/span&gt;&lt;span style=&quot;color: #0000ff&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot;&gt;    &lt;span style=&quot;color: #0000ff&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #800000&quot;&gt;form&lt;/span&gt; &lt;span style=&quot;color: #ff0000&quot;&gt;id&lt;/span&gt;&lt;span style=&quot;color: #0000ff&quot;&gt;=&quot;form1&quot;&lt;/span&gt; &lt;span style=&quot;color: #ff0000&quot;&gt;runat&lt;/span&gt;&lt;span style=&quot;color: #0000ff&quot;&gt;=&quot;server&quot;&lt;/span&gt;&lt;span style=&quot;color: #0000ff&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot;&gt;    &lt;span style=&quot;color: #0000ff&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #800000&quot;&gt;div&lt;/span&gt;&lt;span style=&quot;color: #0000ff&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot;&gt;        &lt;span style=&quot;color: #0000ff&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #800000&quot;&gt;asp:HyperLink&lt;/span&gt; &lt;span style=&quot;color: #ff0000&quot;&gt;ID&lt;/span&gt;&lt;span style=&quot;color: #0000ff&quot;&gt;=&quot;HyperLink1&quot;&lt;/span&gt; &lt;span style=&quot;color: #ff0000&quot;&gt;runat&lt;/span&gt;&lt;span style=&quot;color: #0000ff&quot;&gt;=&quot;server&quot;&lt;/span&gt; &lt;span style=&quot;color: #ff0000&quot;&gt;NavigateUrl&lt;/span&gt;&lt;span style=&quot;color: #0000ff&quot;&gt;=&quot;Test2.aspx#Link&quot;&lt;/span&gt;&lt;span style=&quot;color: #0000ff&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot;&gt;        錨點連結至Test2.aspx&lt;span style=&quot;color: #0000ff&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span style=&quot;color: #800000&quot;&gt;asp:HyperLink&lt;/span&gt;&lt;span style=&quot;color: #0000ff&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot;&gt;    &lt;span style=&quot;color: #0000ff&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span style=&quot;color: #800000&quot;&gt;div&lt;/span&gt;&lt;span style=&quot;color: #0000ff&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot;&gt;    &lt;span style=&quot;color: #0000ff&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span style=&quot;color: #800000&quot;&gt;form&lt;/span&gt;&lt;span style=&quot;color: #0000ff&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #0000ff&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span style=&quot;color: #800000&quot;&gt;body&lt;/span&gt;&lt;span style=&quot;color: #0000ff&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #0000ff&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span style=&quot;color: #800000&quot;&gt;html&lt;/span&gt;&lt;span style=&quot;color: #0000ff&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;/div&gt;&lt;/div&gt;&lt;br /&gt;&lt;p&gt;&lt;br&gt;並在Test2.aspx中建立1～15數字來區別位置，我們將錨點#Link建立在數字11上&lt;/p&gt;&lt;br /&gt;&lt;div style=&quot;border-bottom: silver 1px solid; text-align: left; border-left: silver 1px solid; padding-bottom: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; padding-left: 4px; width: 97.5%; padding-right: 4px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; max-height: 200px; font-size: 8pt; overflow: auto; border-top: silver 1px solid; cursor: text; border-right: silver 1px solid; padding-top: 4px&quot; id=&quot;codeSnippetWrapper&quot;&gt;&lt;br /&gt;&lt;div style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot; id=&quot;codeSnippet&quot;&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;background-color: #ffff00&quot;&gt;&amp;lt;%@ Page Language=&quot;VB&quot; AutoEventWireup=&quot;false&quot; CodeFile=&quot;Test2.aspx.vb&quot; Inherits=&quot;Test2&quot; %&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot;&gt;&amp;nbsp;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #0000ff&quot;&gt;&amp;lt;!&lt;/span&gt;&lt;span style=&quot;color: #800000&quot;&gt;DOCTYPE&lt;/span&gt; &lt;span style=&quot;color: #ff0000&quot;&gt;html&lt;/span&gt; &lt;span style=&quot;color: #ff0000&quot;&gt;PUBLIC&lt;/span&gt; &lt;span style=&quot;color: #0000ff&quot;&gt;&quot;-//W3C//DTD XHTML 1.0 Transitional//EN&quot;&lt;/span&gt; &lt;span style=&quot;color: #0000ff&quot;&gt;&quot;http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd&quot;&lt;/span&gt;&lt;span style=&quot;color: #0000ff&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot;&gt;&amp;nbsp;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #0000ff&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #800000&quot;&gt;html&lt;/span&gt; &lt;span style=&quot;color: #ff0000&quot;&gt;xmlns&lt;/span&gt;&lt;span style=&quot;color: #0000ff&quot;&gt;=&quot;http://www.w3.org/1999/xhtml&quot;&lt;/span&gt;&lt;span style=&quot;color: #0000ff&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #0000ff&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #800000&quot;&gt;head&lt;/span&gt; &lt;span style=&quot;color: #ff0000&quot;&gt;runat&lt;/span&gt;&lt;span style=&quot;color: #0000ff&quot;&gt;=&quot;server&quot;&lt;/span&gt;&lt;span style=&quot;color: #0000ff&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot;&gt;    &lt;span style=&quot;color: #0000ff&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #800000&quot;&gt;title&lt;/span&gt;&lt;span style=&quot;color: #0000ff&quot;&gt;&amp;gt;&amp;lt;/&lt;/span&gt;&lt;span style=&quot;color: #800000&quot;&gt;title&lt;/span&gt;&lt;span style=&quot;color: #0000ff&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #0000ff&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span style=&quot;color: #800000&quot;&gt;head&lt;/span&gt;&lt;span style=&quot;color: #0000ff&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #0000ff&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #800000&quot;&gt;body&lt;/span&gt;&lt;span style=&quot;color: #0000ff&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot;&gt;    &lt;span style=&quot;color: #0000ff&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #800000&quot;&gt;form&lt;/span&gt; &lt;span style=&quot;color: #ff0000&quot;&gt;id&lt;/span&gt;&lt;span style=&quot;color: #0000ff&quot;&gt;=&quot;form1&quot;&lt;/span&gt; &lt;span style=&quot;color: #ff0000&quot;&gt;runat&lt;/span&gt;&lt;span style=&quot;color: #0000ff&quot;&gt;=&quot;server&quot;&lt;/span&gt;&lt;span style=&quot;color: #0000ff&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot;&gt;    &lt;span style=&quot;color: #0000ff&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #800000&quot;&gt;div&lt;/span&gt;&lt;span style=&quot;color: #0000ff&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot;&gt;    第一行&lt;span style=&quot;color: #0000ff&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #800000&quot;&gt;br&lt;/span&gt; &lt;span style=&quot;color: #0000ff&quot;&gt;/&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot;&gt;    1&lt;span style=&quot;color: #0000ff&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #800000&quot;&gt;br&lt;/span&gt; &lt;span style=&quot;color: #0000ff&quot;&gt;/&amp;gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #800000&quot;&gt;br&lt;/span&gt; &lt;span style=&quot;color: #0000ff&quot;&gt;/&amp;gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #800000&quot;&gt;br&lt;/span&gt; &lt;span style=&quot;color: #0000ff&quot;&gt;/&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot;&gt;    2&lt;span style=&quot;color: #0000ff&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #800000&quot;&gt;br&lt;/span&gt; &lt;span style=&quot;color: #0000ff&quot;&gt;/&amp;gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #800000&quot;&gt;br&lt;/span&gt; &lt;span style=&quot;color: #0000ff&quot;&gt;/&amp;gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #800000&quot;&gt;br&lt;/span&gt; &lt;span style=&quot;color: #0000ff&quot;&gt;/&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot;&gt;    3&lt;span style=&quot;color: #0000ff&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #800000&quot;&gt;br&lt;/span&gt; &lt;span style=&quot;color: #0000ff&quot;&gt;/&amp;gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #800000&quot;&gt;br&lt;/span&gt; &lt;span style=&quot;color: #0000ff&quot;&gt;/&amp;gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #800000&quot;&gt;br&lt;/span&gt; &lt;span style=&quot;color: #0000ff&quot;&gt;/&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot;&gt;    4&lt;span style=&quot;color: #0000ff&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #800000&quot;&gt;br&lt;/span&gt; &lt;span style=&quot;color: #0000ff&quot;&gt;/&amp;gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #800000&quot;&gt;br&lt;/span&gt; &lt;span style=&quot;color: #0000ff&quot;&gt;/&amp;gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #800000&quot;&gt;br&lt;/span&gt; &lt;span style=&quot;color: #0000ff&quot;&gt;/&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot;&gt;    5&lt;span style=&quot;color: #0000ff&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #800000&quot;&gt;br&lt;/span&gt; &lt;span style=&quot;color: #0000ff&quot;&gt;/&amp;gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #800000&quot;&gt;br&lt;/span&gt; &lt;span style=&quot;color: #0000ff&quot;&gt;/&amp;gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #800000&quot;&gt;br&lt;/span&gt; &lt;span style=&quot;color: #0000ff&quot;&gt;/&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot;&gt;    6&lt;span style=&quot;color: #0000ff&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #800000&quot;&gt;br&lt;/span&gt; &lt;span style=&quot;color: #0000ff&quot;&gt;/&amp;gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #800000&quot;&gt;br&lt;/span&gt; &lt;span style=&quot;color: #0000ff&quot;&gt;/&amp;gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #800000&quot;&gt;br&lt;/span&gt; &lt;span style=&quot;color: #0000ff&quot;&gt;/&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot;&gt;    7&lt;span style=&quot;color: #0000ff&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #800000&quot;&gt;br&lt;/span&gt; &lt;span style=&quot;color: #0000ff&quot;&gt;/&amp;gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #800000&quot;&gt;br&lt;/span&gt; &lt;span style=&quot;color: #0000ff&quot;&gt;/&amp;gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #800000&quot;&gt;br&lt;/span&gt; &lt;span style=&quot;color: #0000ff&quot;&gt;/&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot;&gt;    8&lt;span style=&quot;color: #0000ff&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #800000&quot;&gt;br&lt;/span&gt; &lt;span style=&quot;color: #0000ff&quot;&gt;/&amp;gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #800000&quot;&gt;br&lt;/span&gt; &lt;span style=&quot;color: #0000ff&quot;&gt;/&amp;gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #800000&quot;&gt;br&lt;/span&gt; &lt;span style=&quot;color: #0000ff&quot;&gt;/&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot;&gt;    9&lt;span style=&quot;color: #0000ff&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #800000&quot;&gt;br&lt;/span&gt; &lt;span style=&quot;color: #0000ff&quot;&gt;/&amp;gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #800000&quot;&gt;br&lt;/span&gt; &lt;span style=&quot;color: #0000ff&quot;&gt;/&amp;gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #800000&quot;&gt;br&lt;/span&gt; &lt;span style=&quot;color: #0000ff&quot;&gt;/&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot;&gt;    10&lt;span style=&quot;color: #0000ff&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #800000&quot;&gt;br&lt;/span&gt; &lt;span style=&quot;color: #0000ff&quot;&gt;/&amp;gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #800000&quot;&gt;br&lt;/span&gt; &lt;span style=&quot;color: #0000ff&quot;&gt;/&amp;gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #800000&quot;&gt;br&lt;/span&gt; &lt;span style=&quot;color: #0000ff&quot;&gt;/&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot;&gt;    &lt;span style=&quot;color: #0000ff&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #800000&quot;&gt;a&lt;/span&gt; &lt;span style=&quot;color: #ff0000&quot;&gt;id&lt;/span&gt;&lt;span style=&quot;color: #0000ff&quot;&gt;=&quot;Link&quot;&lt;/span&gt;&lt;span style=&quot;color: #0000ff&quot;&gt;&amp;gt;&amp;lt;/&lt;/span&gt;&lt;span style=&quot;color: #800000&quot;&gt;a&lt;/span&gt;&lt;span style=&quot;color: #0000ff&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot;&gt;    錨點連結點11&lt;span style=&quot;color: #0000ff&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #800000&quot;&gt;br&lt;/span&gt; &lt;span style=&quot;color: #0000ff&quot;&gt;/&amp;gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #800000&quot;&gt;br&lt;/span&gt; &lt;span style=&quot;color: #0000ff&quot;&gt;/&amp;gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #800000&quot;&gt;br&lt;/span&gt; &lt;span style=&quot;color: #0000ff&quot;&gt;/&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot;&gt;    12&lt;span style=&quot;color: #0000ff&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #800000&quot;&gt;br&lt;/span&gt; &lt;span style=&quot;color: #0000ff&quot;&gt;/&amp;gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #800000&quot;&gt;br&lt;/span&gt; &lt;span style=&quot;color: #0000ff&quot;&gt;/&amp;gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #800000&quot;&gt;br&lt;/span&gt; &lt;span style=&quot;color: #0000ff&quot;&gt;/&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot;&gt;    13&lt;span style=&quot;color: #0000ff&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #800000&quot;&gt;br&lt;/span&gt; &lt;span style=&quot;color: #0000ff&quot;&gt;/&amp;gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #800000&quot;&gt;br&lt;/span&gt; &lt;span style=&quot;color: #0000ff&quot;&gt;/&amp;gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #800000&quot;&gt;br&lt;/span&gt; &lt;span style=&quot;color: #0000ff&quot;&gt;/&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot;&gt;    14&lt;span style=&quot;color: #0000ff&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #800000&quot;&gt;br&lt;/span&gt; &lt;span style=&quot;color: #0000ff&quot;&gt;/&amp;gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #800000&quot;&gt;br&lt;/span&gt; &lt;span style=&quot;color: #0000ff&quot;&gt;/&amp;gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #800000&quot;&gt;br&lt;/span&gt; &lt;span style=&quot;color: #0000ff&quot;&gt;/&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot;&gt;    15&lt;span style=&quot;color: #0000ff&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #800000&quot;&gt;br&lt;/span&gt; &lt;span style=&quot;color: #0000ff&quot;&gt;/&amp;gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #800000&quot;&gt;br&lt;/span&gt; &lt;span style=&quot;color: #0000ff&quot;&gt;/&amp;gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #800000&quot;&gt;br&lt;/span&gt; &lt;span style=&quot;color: #0000ff&quot;&gt;/&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot;&gt;    &lt;span style=&quot;color: #0000ff&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span style=&quot;color: #800000&quot;&gt;div&lt;/span&gt;&lt;span style=&quot;color: #0000ff&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot;&gt;    &lt;span style=&quot;color: #0000ff&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span style=&quot;color: #800000&quot;&gt;form&lt;/span&gt;&lt;span style=&quot;color: #0000ff&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #0000ff&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span style=&quot;color: #800000&quot;&gt;body&lt;/span&gt;&lt;span style=&quot;color: #0000ff&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #0000ff&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span style=&quot;color: #800000&quot;&gt;html&lt;/span&gt;&lt;span style=&quot;color: #0000ff&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;/div&gt;&lt;/div&gt;&lt;br /&gt;&lt;p&gt;&lt;br&gt;好了，現在我們輸入未指定錨點#連結的網址看看Test2.aspx中數字11的位置&lt;br&gt;&lt;a href=&quot;http://localhost/Test/Test2.aspx&quot;&gt;http://localhost/Test/Test2.aspx&lt;/a&gt;，會發現數字11的位置在瀏覽器最下方。&lt;br&gt;&lt;a href=&quot;http://lh6.ggpht.com/_2sQfBxJU9mI/S6R2I-zqBDI/AAAAAAAAMAY/KDftGc9a3UM/s1600-h/2010-03-20_145109%5B3%5D.jpg&quot;&gt;&lt;img style=&quot;border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px&quot; title=&quot;2010-03-20_145109&quot; border=&quot;0&quot; alt=&quot;2010-03-20_145109&quot; src=&quot;http://lh6.ggpht.com/_2sQfBxJU9mI/S6R2KBWV29I/AAAAAAAAMAc/ZxKbDBhErPY/2010-03-20_145109_thumb%5B1%5D.jpg?imgmax=800&quot; width=&quot;259&quot; height=&quot;743&quot;&gt;&lt;/a&gt;&amp;nbsp;&lt;br&gt;&lt;br&gt;現在再透過剛建立的Test.aspx上的HyperLink連結至Test2.aspx看看有何不同。HyperLink的超連結網址為&lt;a href=&quot;http://localhost/Test/Test2.aspx#Link&quot;&gt;http://localhost/Test/Test2.aspx#Link&lt;/a&gt;，數字11的位置可以完整看見了，這就是錨點的用途很簡易實現。&lt;br&gt;&lt;a href=&quot;http://lh3.ggpht.com/_2sQfBxJU9mI/S6R2LSmlQbI/AAAAAAAAMAg/-6E0fB4b3Tg/s1600-h/2010-03-20_144849%5B3%5D.jpg&quot;&gt;&lt;img style=&quot;border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px&quot; title=&quot;2010-03-20_144849&quot; border=&quot;0&quot; alt=&quot;2010-03-20_144849&quot; src=&quot;http://lh6.ggpht.com/_2sQfBxJU9mI/S6R2MSck-oI/AAAAAAAAMAk/KMVhZCLahQo/2010-03-20_144849_thumb%5B1%5D.jpg?imgmax=800&quot; width=&quot;217&quot; height=&quot;744&quot;&gt;&lt;/a&gt;&lt;/p&gt;  </content><link rel='replies' type='application/atom+xml' href='http://tgw1029.blogspot.com/feeds/6452893686142039906/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://tgw1029.blogspot.com/2010/03/aspnetfirefox.html#comment-form' title='1 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2893139382062216061/posts/default/6452893686142039906'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2893139382062216061/posts/default/6452893686142039906'/><link rel='alternate' type='text/html' href='http://tgw1029.blogspot.com/2010/03/aspnetfirefox.html' title='Asp.Net的錨點(#連結)功能，支援FireFox'/><author><name>威筆記</name><uri>http://www.blogger.com/profile/03781053564980189303</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://lh6.ggpht.com/_2sQfBxJU9mI/S6R2KBWV29I/AAAAAAAAMAc/ZxKbDBhErPY/s72-c/2010-03-20_145109_thumb%5B1%5D.jpg?imgmax=800" height="72" width="72"/><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2893139382062216061.post-2973298738987533691</id><published>2010-03-16T21:13:00.001+08:00</published><updated>2010-03-16T21:13:37.680+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Asp.Net"/><title type='text'>DropDownList資料繫結後加入&quot;請選擇&quot;靜態項目</title><content type='html'>&lt;p&gt;在Asp.Net的DropDownList控制項中，除了可以使用資料繫結(DataBind)的方式，也可使用靜態方式建立選項項目，亦可兩者同時建立。我們不用CodeBehind的寫法直接使用滑鼠完成DropDownList同時建立動態與靜態項目，一個很基礎又很實用的技巧記錄如下。&lt;br&gt;&lt;br&gt;首先必須將DropListBox中的&lt;strong&gt;&lt;font color=&quot;#ff0000&quot;&gt;AppendDataBoundItems&lt;/font&gt;&lt;/strong&gt;屬性設定為&lt;strong&gt;True&lt;/strong&gt;，其功用如下方說明所示：&lt;em&gt;&lt;u&gt;將資料繫結項目附加至靜態宣告的清單項目&lt;/u&gt;&lt;/em&gt;。原來Vistual Studio都幫我們預先做好了，只要設定為Ture就可以。&lt;br&gt;&lt;a href=&quot;http://lh6.ggpht.com/_2sQfBxJU9mI/S5-D1Y4NtQI/AAAAAAAAL_8/63ye0RfjcHg/s1600-h/2010-03-16_210002%5B2%5D.jpg&quot;&gt;&lt;strong&gt;&lt;img style=&quot;border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px&quot; title=&quot;2010-03-16_210002&quot; border=&quot;0&quot; alt=&quot;2010-03-16_210002&quot; src=&quot;http://lh5.ggpht.com/_2sQfBxJU9mI/S5-D3Ugks-I/AAAAAAAAMAA/qRp2a4o-Ezg/2010-03-16_210002_thumb.jpg?imgmax=800&quot; width=&quot;239&quot; height=&quot;234&quot;&gt;&lt;/strong&gt;&lt;/a&gt;&lt;strong&gt;&amp;nbsp;&lt;br&gt;&lt;br&gt;&lt;/strong&gt;接著將靜態項目加入DropDownList中，方法如下圖：&lt;br&gt;&lt;a href=&quot;http://lh3.ggpht.com/_2sQfBxJU9mI/S5-D4CTjbFI/AAAAAAAAMAE/wfAJytQwqTs/s1600-h/2010-03-16_210128%5B2%5D.jpg&quot;&gt;&lt;img style=&quot;border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px&quot; title=&quot;2010-03-16_210128&quot; border=&quot;0&quot; alt=&quot;2010-03-16_210128&quot; src=&quot;http://lh3.ggpht.com/_2sQfBxJU9mI/S5-D5BQ34eI/AAAAAAAAMAI/wD6UJ5VWjus/2010-03-16_210128_thumb.jpg?imgmax=800&quot; width=&quot;244&quot; height=&quot;127&quot;&gt;&lt;/a&gt; &lt;br&gt;&lt;a href=&quot;http://lh6.ggpht.com/_2sQfBxJU9mI/S5-D6QcFRdI/AAAAAAAAMAM/AlAnZ45CM-o/s1600-h/2010-03-16_210303%5B3%5D.jpg&quot;&gt;&lt;img style=&quot;border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px&quot; title=&quot;2010-03-16_210303&quot; border=&quot;0&quot; alt=&quot;2010-03-16_210303&quot; src=&quot;http://lh5.ggpht.com/_2sQfBxJU9mI/S5-D7TPMQ-I/AAAAAAAAMAQ/8SuIB7mZSa0/2010-03-16_210303_thumb%5B1%5D.jpg?imgmax=800&quot; width=&quot;503&quot; height=&quot;339&quot;&gt;&lt;/a&gt; &lt;br&gt;完成後的程式碼如下：&lt;br&gt;&amp;lt;asp:DropDownList ID=&quot;DropDownList&quot; runat=&quot;server&quot;&amp;nbsp; DataSourceID=&quot;SqlDataSource&quot; DataTextField=&quot;Test1&quot; DataValueField=&quot;Test2&quot;&amp;nbsp; &lt;strong&gt;&lt;font color=&quot;#ff0000&quot;&gt;AppendDataBoundItems=&quot;True&quot;&lt;/font&gt;&lt;/strong&gt; &amp;gt;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;strong&gt;&lt;font color=&quot;#ff0000&quot;&gt;&amp;lt;asp:ListItem Value=&quot;0&quot;&amp;gt;請選擇&amp;lt;/asp:ListItem&amp;gt;&lt;br&gt;&lt;/font&gt;&lt;/strong&gt;&amp;lt;/asp:DropDownList&amp;gt;&lt;br&gt;&lt;/p&gt; &lt;p&gt;&amp;lt;asp:SqlDataSource ID=&quot;SqlDataSource&quot; runat=&quot;server&quot;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ConnectionString=&quot;&amp;lt;%$ ConnectionStrings:TestConnectionString %&amp;gt;&quot; &lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; SelectCommand=&quot;Select * From Test&quot;&amp;gt;&lt;br&gt;&amp;lt;/asp:SqlDataSource&amp;gt;&amp;nbsp;   </content><link rel='replies' type='application/atom+xml' href='http://tgw1029.blogspot.com/feeds/2973298738987533691/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://tgw1029.blogspot.com/2010/03/dropdownlist.html#comment-form' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2893139382062216061/posts/default/2973298738987533691'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2893139382062216061/posts/default/2973298738987533691'/><link rel='alternate' type='text/html' href='http://tgw1029.blogspot.com/2010/03/dropdownlist.html' title='DropDownList資料繫結後加入&amp;quot;請選擇&amp;quot;靜態項目'/><author><name>威筆記</name><uri>http://www.blogger.com/profile/03781053564980189303</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://lh5.ggpht.com/_2sQfBxJU9mI/S5-D3Ugks-I/AAAAAAAAMAA/qRp2a4o-Ezg/s72-c/2010-03-16_210002_thumb.jpg?imgmax=800" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2893139382062216061.post-4664219889253941541</id><published>2010-03-16T20:38:00.001+08:00</published><updated>2010-03-16T20:40:22.580+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Asp.Net"/><title type='text'>Class類別中的Response、Server、Request未宣告解決方法(使用HttpContext.Current屬性)</title><content type='html'>&lt;p&gt;對於需要重複使用的程式碼，我們通常可以寫在Asp.Net的Public Class類別中，再到WebForm中呼叫。例如在Test.aspx.vb的Page Load中使用此段程式碼來判斷使用者是否已登入。&lt;/p&gt; &lt;div style=&quot;border-bottom: silver 1px solid; text-align: left; border-left: silver 1px solid; padding-bottom: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; padding-left: 4px; width: 97.5%; padding-right: 4px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; max-height: 200px; font-size: 8pt; overflow: auto; border-top: silver 1px solid; cursor: text; border-right: silver 1px solid; padding-top: 4px&quot; id=&quot;codeSnippetWrapper&quot;&gt; &lt;div style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot; id=&quot;codeSnippet&quot;&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #0000ff&quot;&gt;Protected&lt;/span&gt; &lt;span style=&quot;color: #0000ff&quot;&gt;Sub&lt;/span&gt; Page_Load(&lt;span style=&quot;color: #0000ff&quot;&gt;ByVal&lt;/span&gt; sender &lt;span style=&quot;color: #0000ff&quot;&gt;As&lt;/span&gt; &lt;span style=&quot;color: #0000ff&quot;&gt;Object&lt;/span&gt;, &lt;span style=&quot;color: #0000ff&quot;&gt;ByVal&lt;/span&gt; e &lt;span style=&quot;color: #0000ff&quot;&gt;As&lt;/span&gt; System.EventArgs) &lt;span style=&quot;color: #0000ff&quot;&gt;Handles&lt;/span&gt; &lt;span style=&quot;color: #0000ff&quot;&gt;Me&lt;/span&gt;.Load&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot;&gt;    &lt;span style=&quot;color: #0000ff&quot;&gt;If&lt;/span&gt; Server.HtmlEncode(Request.Cookies(&lt;span style=&quot;color: #006080&quot;&gt;&quot;UserInfo&quot;&lt;/span&gt;)(&lt;span style=&quot;color: #006080&quot;&gt;&quot;Login&quot;&lt;/span&gt;)) = &lt;span style=&quot;color: #0000ff&quot;&gt;True&lt;/span&gt; &lt;span style=&quot;color: #0000ff&quot;&gt;Then&lt;/span&gt;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot;&gt;        Response.Redirect(&lt;span style=&quot;color: #006080&quot;&gt;&quot;Default.aspx&quot;&lt;/span&gt;)&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot;&gt;    &lt;span style=&quot;color: #0000ff&quot;&gt;Else&lt;/span&gt;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot;&gt;        Response.Redirect(&lt;span style=&quot;color: #006080&quot;&gt;&quot;Login.aspx&quot;&lt;/span&gt;)&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot;&gt;    &lt;span style=&quot;color: #0000ff&quot;&gt;End&lt;/span&gt; &lt;span style=&quot;color: #0000ff&quot;&gt;If&lt;/span&gt;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #0000ff&quot;&gt;End&lt;/span&gt; Sub&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;/div&gt;&lt;/div&gt;&lt;br /&gt;&lt;p&gt;&lt;br&gt;我們需要在每一個頁面都先進行使用者是否登入的判斷，因此將此區段程式碼取出寫在Public Class類別中提供給每個頁面呼叫。&lt;br&gt;&lt;br&gt;在Asp.Net中建立一個名為Class1.vb的類別，接著把上面的程式碼貼入Public Sub中會發現如下圖畫面中的錯誤：&lt;br&gt;&lt;a href=&quot;http://lh3.ggpht.com/_2sQfBxJU9mI/S5972GQLe0I/AAAAAAAAL_0/gLtm1Iv2idE/s1600-h/2010-03-16_201928%5B4%5D.jpg&quot;&gt;&lt;img style=&quot;border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px&quot; title=&quot;2010-03-16_201928&quot; border=&quot;0&quot; alt=&quot;2010-03-16_201928&quot; src=&quot;http://lh5.ggpht.com/_2sQfBxJU9mI/S5973PP1fcI/AAAAAAAAL_4/4Bh8d151vTE/2010-03-16_201928_thumb%5B2%5D.jpg?imgmax=800&quot; width=&quot;504&quot; height=&quot;142&quot;&gt;&lt;/a&gt; &lt;/p&gt;&lt;br /&gt;&lt;p&gt;在Class1.vb中出現&lt;strong&gt;Server、Request、Response&lt;/strong&gt;皆&lt;strong&gt;&lt;font color=&quot;#ff0000&quot;&gt;未宣告&lt;/font&gt;&lt;/strong&gt;的錯誤訊息。&lt;br&gt;&lt;br&gt;因為&lt;strong&gt;Server、Request、Response&lt;/strong&gt;的預設值是Page，即Page.Server&lt;strong&gt;、&lt;/strong&gt;Page.Request、Page.Response。也就是說Page.Response的返回值是當前頁面的值，而在Class1.vb類別中無法得知當前頁面的值為何。&lt;br&gt;&lt;br&gt;因此需要透過Http從來源頁面中傳遞告知當前頁面為何，我們在每個錯誤訊息前面加上&lt;strong&gt;&lt;a href=&quot;http://msdn.microsoft.com/zh-tw/library/system.web.httpcontext.current.aspx&quot; target=&quot;_blank&quot;&gt;HttpContext.Current&lt;/a&gt;&lt;/strong&gt;屬性：&lt;/p&gt;&lt;br /&gt;&lt;div style=&quot;border-bottom: silver 1px solid; text-align: left; border-left: silver 1px solid; padding-bottom: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; padding-left: 4px; width: 97.5%; padding-right: 4px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; max-height: 200px; font-size: 8pt; overflow: auto; border-top: silver 1px solid; cursor: text; border-right: silver 1px solid; padding-top: 4px&quot; id=&quot;codeSnippetWrapper&quot;&gt;&lt;br /&gt;&lt;div style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot; id=&quot;codeSnippet&quot;&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #0000ff&quot;&gt;Imports&lt;/span&gt; Microsoft.VisualBasic&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot;&gt;&amp;nbsp;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #0000ff&quot;&gt;Public&lt;/span&gt; &lt;span style=&quot;color: #0000ff&quot;&gt;Class&lt;/span&gt; Class1&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot;&gt;    &lt;span style=&quot;color: #0000ff&quot;&gt;Public&lt;/span&gt; &lt;span style=&quot;color: #0000ff&quot;&gt;Sub&lt;/span&gt; Get_Cookie()&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot;&gt;        &lt;span style=&quot;color: #0000ff&quot;&gt;If&lt;/span&gt; HttpContext.Current.Server.HtmlEncode _&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot;&gt;        (HttpContext.Current.Request.Cookies(&lt;span style=&quot;color: #006080&quot;&gt;&quot;UserInfo&quot;&lt;/span&gt;)(&lt;span style=&quot;color: #006080&quot;&gt;&quot;Login&quot;&lt;/span&gt;)) = &lt;span style=&quot;color: #0000ff&quot;&gt;True&lt;/span&gt; &lt;span style=&quot;color: #0000ff&quot;&gt;Then&lt;/span&gt;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot;&gt;            HttpContext.Current.Response.Redirect(&lt;span style=&quot;color: #006080&quot;&gt;&quot;Default.aspx&quot;&lt;/span&gt;)&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot;&gt;        &lt;span style=&quot;color: #0000ff&quot;&gt;Else&lt;/span&gt;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot;&gt;            HttpContext.Current.Response.Redirect(&lt;span style=&quot;color: #006080&quot;&gt;&quot;Login.aspx&quot;&lt;/span&gt;)&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot;&gt;        &lt;span style=&quot;color: #0000ff&quot;&gt;End&lt;/span&gt; &lt;span style=&quot;color: #0000ff&quot;&gt;If&lt;/span&gt;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot;&gt;    &lt;span style=&quot;color: #0000ff&quot;&gt;End&lt;/span&gt; &lt;span style=&quot;color: #0000ff&quot;&gt;Sub&lt;/span&gt;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #0000ff&quot;&gt;End&lt;/span&gt; Class&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;/div&gt;&lt;/div&gt;&lt;br /&gt;&lt;p&gt;&lt;br&gt;最後，將Test.aspx.vb的Page_Load改為Call呼叫的方式來使用Class1.vb類別&lt;/p&gt;&lt;br /&gt;&lt;div style=&quot;border-bottom: silver 1px solid; text-align: left; border-left: silver 1px solid; padding-bottom: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; padding-left: 4px; width: 97.5%; padding-right: 4px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; max-height: 200px; font-size: 8pt; overflow: auto; border-top: silver 1px solid; cursor: text; border-right: silver 1px solid; padding-top: 4px&quot; id=&quot;codeSnippetWrapper&quot;&gt;&lt;br /&gt;&lt;div style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot; id=&quot;codeSnippet&quot;&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #0000ff&quot;&gt;Protected&lt;/span&gt; &lt;span style=&quot;color: #0000ff&quot;&gt;Sub&lt;/span&gt; Page_Load(&lt;span style=&quot;color: #0000ff&quot;&gt;ByVal&lt;/span&gt; sender &lt;span style=&quot;color: #0000ff&quot;&gt;As&lt;/span&gt; &lt;span style=&quot;color: #0000ff&quot;&gt;Object&lt;/span&gt;, &lt;span style=&quot;color: #0000ff&quot;&gt;ByVal&lt;/span&gt; e &lt;span style=&quot;color: #0000ff&quot;&gt;As&lt;/span&gt; System.EventArgs) &lt;span style=&quot;color: #0000ff&quot;&gt;Handles&lt;/span&gt; &lt;span style=&quot;color: #0000ff&quot;&gt;Me&lt;/span&gt;.Load&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot;&gt;    &lt;span style=&quot;color: #0000ff&quot;&gt;Dim&lt;/span&gt; Class1 &lt;span style=&quot;color: #0000ff&quot;&gt;As&lt;/span&gt; &lt;span style=&quot;color: #0000ff&quot;&gt;New&lt;/span&gt; Class1&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot;&gt;    &lt;span style=&quot;color: #0000ff&quot;&gt;Call&lt;/span&gt; Class1.Get_Cookie()&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #0000ff&quot;&gt;End&lt;/span&gt; Sub&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;/div&gt;&lt;/div&gt;  </content><link rel='replies' type='application/atom+xml' href='http://tgw1029.blogspot.com/feeds/4664219889253941541/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://tgw1029.blogspot.com/2010/03/classresponseserverrequesthttpcontextcu.html#comment-form' title='3 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2893139382062216061/posts/default/4664219889253941541'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2893139382062216061/posts/default/4664219889253941541'/><link rel='alternate' type='text/html' href='http://tgw1029.blogspot.com/2010/03/classresponseserverrequesthttpcontextcu.html' title='Class類別中的Response、Server、Request未宣告解決方法(使用HttpContext.Current屬性)'/><author><name>威筆記</name><uri>http://www.blogger.com/profile/03781053564980189303</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://lh5.ggpht.com/_2sQfBxJU9mI/S5973PP1fcI/AAAAAAAAL_4/4Bh8d151vTE/s72-c/2010-03-16_201928_thumb%5B2%5D.jpg?imgmax=800" height="72" width="72"/><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2893139382062216061.post-5689876207218789168</id><published>2010-03-10T21:00:00.002+08:00</published><updated>2010-03-20T15:19:16.842+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Asp.Net"/><title type='text'>Alert視窗確認後Response.Redirect轉跳頁面的替代方法(含ScriptManager Ajax頁面轉跳方法)</title><content type='html'>&lt;a href=&quot;http://lh6.ggpht.com/_2sQfBxJU9mI/S5eX31M7q1I/AAAAAAAAL_c/3G9rDkJhyC8/s1600-h/2010-03-10_194728%5B6%5D.jpg&quot;&gt;&lt;img style=&quot;border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px&quot; title=&quot;2010-03-10_194728&quot; border=&quot;0&quot; alt=&quot;2010-03-10_194728&quot; src=&quot;http://lh4.ggpht.com/_2sQfBxJU9mI/S5eX46QNtTI/AAAAAAAAL_g/aU6kZpHawOE/2010-03-10_194728_thumb%5B4%5D.jpg?imgmax=800&quot; width=&quot;359&quot; height=&quot;115&quot;&gt;&lt;/a&gt; &lt;br&gt;在Asp.net中，需要在操作例如送出動作時，先&lt;b&gt;&lt;i&gt;彈出確認視窗之後轉跳到指定頁面&lt;/i&gt;&lt;/b&gt;的功能其實是非常常見的。此功能的實作算是非常基礎的，很多剛開始嘗試寫Asp.Net的人直覺寫法是一段JavaScript語法加上Response.Redirect來實現：&lt;br&gt;&lt;b&gt;&lt;span style=&quot;color: black&quot;&gt;Response.Write&amp;nbsp;&amp;nbsp; &quot;&amp;lt;script &amp;gt;alert(&#39;更新成功！&#39;);&amp;lt;/script&amp;gt;&quot;&lt;br&gt;Response.Redirect(&quot;Default.aspx&quot;)&lt;br&gt;&lt;br&gt;&lt;/span&gt;&lt;/b&gt;此種直覺的寫法在實際執行時會發現，Alert的警告視窗不出現就直接轉跳頁面到Default.aspx去了。我也寫過這種無法正確執行的程式碼，因而誤以為自己語法寫錯了。Alert視窗呢？回頭仔細檢查語法發現並沒有寫錯，為何不顯示Alert呢？&lt;br&gt;&lt;br&gt;這是因為Response.Redirect是在未送出HttpHead前便執行了，而JavaScript又是需要在Client端才能Run，也就是說用了Response.Redirect在返回Client端以前頁面就已經被轉向至Default.aspx，那麼原本頁面的Alert便無法執行了。&lt;br&gt;&lt;br&gt;瞭解原因後，就可以使用其它方法來替代Response.Redirect來實現轉跳的功能。在JavaScript語法中本身已有頁面轉跳的功能語法，因此我們將上面原本無法正確執行的兩行程式碼合併為一行：&lt;br&gt;&lt;b&gt;&lt;span style=&quot;color: black&quot;&gt;Response.Write(&quot;&amp;lt;script&amp;gt;alert(&#39;修改成功!&#39;); &lt;span style=&quot;color: red&quot;&gt;location.href=&#39;Default.aspx&#39;;&lt;/span&gt; &amp;lt;/script&amp;gt;&quot;)&lt;/span&gt;&lt;br&gt;&lt;br&gt;&lt;/b&gt;直接在Alert後使用location.href=』轉跳網址...』，如此便可避免因頁面已轉跳無法將JavaScript返回Client端執行的問題。&lt;br&gt;&lt;br&gt;另外一種情況為在頁面中使用了&lt;b&gt;ScriptManager&lt;/b&gt;來實現Ajax的頁面。含有Ajax功能的頁面若使用上述方法來轉跳頁面，會發現Alert視窗也無法正確顯示出來，需改為下列的程式碼：&lt;br&gt;&lt;b&gt;ScriptManager.RegisterStartupScript(Me, Me.GetType(), &quot;alert&quot;, &quot;alert(&#39;修改成功!&#39;); location.href=&#39;Default.aspx&#39;;&quot;, True)&lt;br&gt;&lt;br&gt;&lt;/b&gt;RegisterStartupScript類似Response.Write功能相仿，多了的Type與Key的參數。實際在顯示畫面的差別為，使用Response.Write時彈出的Alert視窗後面的頁面是空白的看不到任何頁面內容：&lt;br&gt;&amp;nbsp;&lt;a href=&quot;http://lh4.ggpht.com/_2sQfBxJU9mI/S5eX5xgtY2I/AAAAAAAAL_k/ok4lrhP_pdQ/s1600-h/2010-03-10_203629%5B3%5D.jpg&quot;&gt;&lt;img style=&quot;border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px&quot; title=&quot;2010-03-10_203629&quot; border=&quot;0&quot; alt=&quot;2010-03-10_203629&quot; src=&quot;http://lh6.ggpht.com/_2sQfBxJU9mI/S5eX7PAKn_I/AAAAAAAAL_o/cIQIBKMY34g/2010-03-10_203629_thumb%5B1%5D.jpg?imgmax=800&quot; width=&quot;455&quot; height=&quot;204&quot;&gt;&lt;/a&gt;&amp;nbsp; &lt;br&gt;&lt;br&gt;使用RegisterStartupScript時彈出的Alert視窗後面的頁面內容是可見的：&lt;br&gt;&lt;a href=&quot;http://lh4.ggpht.com/_2sQfBxJU9mI/S5eX8nDepvI/AAAAAAAAL_s/urA09QDQ8WI/s1600-h/2010-03-10_203556%5B10%5D.jpg&quot;&gt;&lt;img style=&quot;border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px&quot; title=&quot;2010-03-10_203556&quot; border=&quot;0&quot; alt=&quot;2010-03-10_203556&quot; src=&quot;http://lh4.ggpht.com/_2sQfBxJU9mI/S5eX9o8a_uI/AAAAAAAAL_w/1yWrgAjSb0Y/2010-03-10_203556_thumb%5B6%5D.jpg?imgmax=800&quot; width=&quot;484&quot; height=&quot;153&quot;&gt;&lt;/a&gt; &lt;br&gt;&lt;br&gt;&lt;b&gt;&lt;span style=&quot;color: blue&quot;&gt;補充：&lt;/span&gt;&lt;/b&gt;&lt;br&gt;不含ScriptManager Ajax功能頁面的RegisterStartupScript寫法：&lt;br&gt;&lt;b&gt;Page.ClientScript.RegisterStartupScript(Me.GetType(), &quot;Test&quot;, &quot;&amp;lt;script&amp;gt;alert(&#39;修改成功!&#39;);location.href=&#39;Default.aspx&#39;;&amp;lt;/script&amp;gt;&quot;)&lt;/b&gt;  </content><link rel='replies' type='application/atom+xml' href='http://tgw1029.blogspot.com/feeds/5689876207218789168/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://tgw1029.blogspot.com/2010/03/alertresponseredirectscriptmanager-ajax.html#comment-form' title='8 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2893139382062216061/posts/default/5689876207218789168'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2893139382062216061/posts/default/5689876207218789168'/><link rel='alternate' type='text/html' href='http://tgw1029.blogspot.com/2010/03/alertresponseredirectscriptmanager-ajax.html' title='Alert視窗確認後Response.Redirect轉跳頁面的替代方法(含ScriptManager Ajax頁面轉跳方法)'/><author><name>威筆記</name><uri>http://www.blogger.com/profile/03781053564980189303</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://lh4.ggpht.com/_2sQfBxJU9mI/S5eX46QNtTI/AAAAAAAAL_g/aU6kZpHawOE/s72-c/2010-03-10_194728_thumb%5B4%5D.jpg?imgmax=800" height="72" width="72"/><thr:total>8</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2893139382062216061.post-8152659577683248370</id><published>2010-03-09T21:50:00.001+08:00</published><updated>2010-03-09T21:53:53.130+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Asp.Net"/><title type='text'>HyperLink使用Eval繫結資料庫傳遞QueryString值</title><content type='html'>&lt;p&gt;要實作的功能為網站首頁最新公告欄位，我們想要透過點擊公告主題來進入詳情頁面(PostDetail.aspx)，如下圖：&lt;br&gt;&lt;a href=&quot;http://lh3.ggpht.com/_2sQfBxJU9mI/S5ZSFcfTgHI/AAAAAAAAL_U/VYLsibvqMek/s1600-h/2010-03-09_213050%5B5%5D.jpg&quot;&gt;&lt;img style=&quot;border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px&quot; title=&quot;2010-03-09_213050&quot; border=&quot;0&quot; alt=&quot;2010-03-09_213050&quot; src=&quot;http://lh3.ggpht.com/_2sQfBxJU9mI/S5ZSGUCLgVI/AAAAAAAAL_Y/Ywukcgg4tNs/2010-03-09_213050_thumb%5B3%5D.jpg?imgmax=800&quot; width=&quot;504&quot; height=&quot;77&quot;&gt;&lt;/a&gt; &lt;/p&gt; &lt;p&gt;&lt;br&gt;紅框處使用&lt;strong&gt;HyperLink&lt;/strong&gt;來繫結公告主題，而&lt;strong&gt;HyperLink&lt;/strong&gt;的NavigateUrl屬性我們要連結至詳情頁面(PostDetail.aspx)並使用QueryString傳值的方式來傳遞公告編號至詳情頁面。&lt;br&gt;&lt;br&gt;若是屬於GridView中的&lt;strong&gt;HyperLink&lt;/strong&gt;其傳遞QueryString的寫法是：PostDetail.aspx?公告編號={0}，其中{0}便是繫結了資料庫的公告編號，GridView等於自動幫你繫結好了。那麼，若是使用單獨的&lt;strong&gt;HyperLink&lt;/strong&gt;控制項，可以使用&lt;strong&gt;Eval&lt;/strong&gt;繫結寫法的方式來傳遞QueryString值。&lt;br&gt;&lt;br&gt;其寫法如下：&lt;br&gt;&amp;lt;asp:HyperLink ID=&quot;HyperLink&quot; runat=&quot;server&quot; &lt;br&gt;NavigateUrl=&lt;strong&gt;&lt;font color=&quot;#ff0000&quot;&gt;&#39;&amp;lt;%# &quot;PostDetail.aspx?PostID=&quot; &amp;amp; Eval(&quot;公告編號&quot;) %&amp;gt;&#39;&lt;/font&gt;&lt;/strong&gt; &amp;gt;&lt;br&gt;&amp;lt;%# Eval(&quot;主題&quot;) %&amp;gt;&amp;lt;/asp:HyperLink&amp;gt;&lt;br&gt;&lt;br&gt;&lt;font color=&quot;#808080&quot;&gt;※&amp;nbsp; 前提是別忘了先將欲繫結的資料欄位Select出來。&lt;/font&gt;&lt;/p&gt;  </content><link rel='replies' type='application/atom+xml' href='http://tgw1029.blogspot.com/feeds/8152659577683248370/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://tgw1029.blogspot.com/2010/03/hyperlinkevalquerystring.html#comment-form' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2893139382062216061/posts/default/8152659577683248370'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2893139382062216061/posts/default/8152659577683248370'/><link rel='alternate' type='text/html' href='http://tgw1029.blogspot.com/2010/03/hyperlinkevalquerystring.html' title='HyperLink使用Eval繫結資料庫傳遞QueryString值'/><author><name>威筆記</name><uri>http://www.blogger.com/profile/03781053564980189303</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://lh3.ggpht.com/_2sQfBxJU9mI/S5ZSGUCLgVI/AAAAAAAAL_Y/Ywukcgg4tNs/s72-c/2010-03-09_213050_thumb%5B3%5D.jpg?imgmax=800" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2893139382062216061.post-5832966238671638959</id><published>2010-02-26T22:14:00.001+08:00</published><updated>2010-02-26T22:20:42.417+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Asp.Net"/><title type='text'>GridView中使用CommandArgument取得Button按哪一列(ListView同樣適用)</title><content type='html'>&lt;p&gt;在Asp.net中Button有個非常好使用的屬性：&lt;font color=&quot;#ff0000&quot;&gt;&lt;strong&gt;CommandArgument&lt;br&gt;&lt;/strong&gt;&lt;font color=&quot;#000000&quot;&gt;MSDN對&lt;a href=&quot;http://msdn.microsoft.com/zh-tw/library/system.web.ui.webcontrols.button.commandargument%28VS.80%29.aspx&quot; target=&quot;_blank&quot;&gt;CommandArgument&lt;/a&gt;的解釋是：取得或設定選擇性 (Optional) 參數，與相關的 CommandName 一起傳遞至 Command 事件。&lt;/font&gt;&lt;br&gt;&lt;/font&gt;配合GridView、ListView使用起來可以實現判斷點擊Button是哪一列的功能。&lt;br&gt;&lt;br&gt;要實現判斷按了哪一列有許多種不同作法，使用Button的CommandArgument屬性只是其中之一，但是我個人覺得最方便也最直覺的設定方法。&lt;br&gt;&lt;br&gt;在 Visturl Studio 中可以使用滑鼠點擊方式來設定&lt;strong&gt;CommandArgument&lt;/strong&gt;的繫結，方式如下：&lt;br&gt;&lt;br&gt;此例在GridView中使用ButtonField設置了刪除按鈕，接著我們先將其轉換為&lt;strong&gt;TemplateField&lt;/strong&gt;模式以利我們後續自定一些設定。&lt;br&gt;&lt;a href=&quot;http://lh4.ggpht.com/_2sQfBxJU9mI/S4fXRq5SUAI/AAAAAAAAL-8/asZ5EnmtGcs/s1600-h/2010-02-26_213521%5B3%5D.jpg&quot;&gt;&lt;img style=&quot;border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px&quot; title=&quot;2010-02-26_213521&quot; border=&quot;0&quot; alt=&quot;2010-02-26_213521&quot; src=&quot;http://lh3.ggpht.com/_2sQfBxJU9mI/S4fXSkddpSI/AAAAAAAAL_A/wuuczMslJJo/2010-02-26_213521_thumb%5B1%5D.jpg?imgmax=800&quot; width=&quot;334&quot; height=&quot;263&quot;&gt;&lt;/a&gt; &lt;br&gt;&lt;br&gt;接著點擊GridView視覺化視窗中的小箭頭 &amp;gt; 進入&lt;strong&gt;編輯樣板&lt;/strong&gt;，找到欲設定的刪除按鈕後，再點擊小箭頭 &amp;gt; &lt;strong&gt;編輯DataBinding&lt;/strong&gt;。&lt;br&gt;&lt;a href=&quot;http://lh3.ggpht.com/_2sQfBxJU9mI/S4fXTvydQvI/AAAAAAAAL_E/Bou8wMh3X3Y/s1600-h/2010-02-26_213213%5B3%5D.jpg&quot;&gt;&lt;img style=&quot;border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px&quot; title=&quot;2010-02-26_213213&quot; border=&quot;0&quot; alt=&quot;2010-02-26_213213&quot; src=&quot;http://lh4.ggpht.com/_2sQfBxJU9mI/S4fXUoV2-NI/AAAAAAAAL_I/yfI8g67meWo/2010-02-26_213213_thumb%5B1%5D.jpg?imgmax=800&quot; width=&quot;289&quot; height=&quot;176&quot;&gt;&lt;/a&gt; &lt;br&gt;&lt;br&gt;重要設定在此：在DataBindings設定視窗中，要選擇&lt;font color=&quot;#ff0000&quot;&gt;&lt;strong&gt;CommandArgument&lt;/strong&gt;&lt;/font&gt;&lt;font color=&quot;#000000&quot;&gt;來作資料繫結的動作。接著選取欄位繫結(F)下拉選取欲繫結的選項，通常必須選擇作為等下要設定為SQL Delete 語法 Where 條件的選項。(若一開始無法選擇欄位繫結，點擊下方重新整理結構描述後即可)&lt;/font&gt;&lt;br&gt;&lt;a href=&quot;http://lh5.ggpht.com/_2sQfBxJU9mI/S4fXWOTdJ5I/AAAAAAAAL_M/I3J441ZJ2mg/s1600-h/2010-02-26_213417%5B4%5D.jpg&quot;&gt;&lt;img style=&quot;border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px&quot; title=&quot;2010-02-26_213417&quot; border=&quot;0&quot; alt=&quot;2010-02-26_213417&quot; src=&quot;http://lh5.ggpht.com/_2sQfBxJU9mI/S4fXXLktj9I/AAAAAAAAL_Q/MmEu0DSjA4Q/2010-02-26_213417_thumb%5B2%5D.jpg?imgmax=800&quot; width=&quot;504&quot; height=&quot;369&quot;&gt;&lt;/a&gt;&lt;br&gt;&lt;br&gt;設定完成後，GridView中刪除按鈕便會多了&lt;strong&gt;CommandArgument=&#39;&amp;lt;%# Eval(&quot;拜訪編號&quot;) %&amp;gt;&#39;&lt;/strong&gt;這行程式碼。&lt;/p&gt; &lt;div style=&quot;border-bottom: silver 1px solid; text-align: left; border-left: silver 1px solid; padding-bottom: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; padding-left: 4px; width: 97.5%; padding-right: 4px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; max-height: 200px; font-size: 8pt; overflow: auto; border-top: silver 1px solid; cursor: text; border-right: silver 1px solid; padding-top: 4px&quot; id=&quot;codeSnippetWrapper&quot;&gt; &lt;div style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot; id=&quot;codeSnippet&quot;&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #0000ff&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #800000&quot;&gt;asp:TemplateField&lt;/span&gt; &lt;span style=&quot;color: #ff0000&quot;&gt;ShowHeader&lt;/span&gt;&lt;span style=&quot;color: #0000ff&quot;&gt;=&quot;False&quot;&lt;/span&gt;&lt;span style=&quot;color: #0000ff&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot;&gt;     &lt;span style=&quot;color: #0000ff&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #800000&quot;&gt;ItemTemplate&lt;/span&gt;&lt;span style=&quot;color: #0000ff&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot;&gt;        &lt;span style=&quot;color: #0000ff&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #800000&quot;&gt;asp:Button&lt;/span&gt; &lt;span style=&quot;color: #ff0000&quot;&gt;ID&lt;/span&gt;&lt;span style=&quot;color: #0000ff&quot;&gt;=&quot;Button2&quot;&lt;/span&gt; &lt;span style=&quot;color: #ff0000&quot;&gt;runat&lt;/span&gt;&lt;span style=&quot;color: #0000ff&quot;&gt;=&quot;server&quot;&lt;/span&gt; &lt;span style=&quot;color: #ff0000&quot;&gt;CausesValidation&lt;/span&gt;&lt;span style=&quot;color: #0000ff&quot;&gt;=&quot;False&quot;&lt;/span&gt; &lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot;&gt;            &lt;span style=&quot;color: #ff0000&quot;&gt;CommandName&lt;/span&gt;&lt;span style=&quot;color: #0000ff&quot;&gt;=&quot;Delete_VI&quot;&lt;/span&gt; &lt;span style=&quot;color: #ff0000&quot;&gt;Text&lt;/span&gt;&lt;span style=&quot;color: #0000ff&quot;&gt;=&quot;刪除&quot;&lt;/span&gt; &lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot;&gt;            &lt;span style=&quot;color: #ff0000&quot;&gt;OnClientClick&lt;/span&gt; = &lt;span style=&quot;color: #0000ff&quot;&gt;&quot;if (confirm(&#39;您確定要刪除嗎?&#39;)==false) {return false;}&quot;&lt;/span&gt; &lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot;&gt;            &lt;span style=&quot;color: #ff0000&quot;&gt;CommandArgument&lt;/span&gt;&lt;span style=&quot;color: #0000ff&quot;&gt;=&#39;&amp;lt;%# Eval(&quot;拜訪編號&quot;) %&amp;gt;&#39;&lt;/span&gt; &lt;span style=&quot;color: #0000ff&quot;&gt;/&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot;&gt;     &lt;span style=&quot;color: #0000ff&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span style=&quot;color: #800000&quot;&gt;ItemTemplate&lt;/span&gt;&lt;span style=&quot;color: #0000ff&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #0000ff&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span style=&quot;color: #800000&quot;&gt;asp:TemplateField&lt;/span&gt;&lt;span style=&quot;color: #0000ff&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;/div&gt;&lt;/div&gt;&lt;br /&gt;&lt;p&gt;&lt;br&gt;最後在aspx.vb中以CodeBehind方式撰寫SQL的Delete程式碼：&lt;br&gt;由於GridView中可能不只存在一個按鈕，因此必須先在&lt;strong&gt;GridView_RowCommand&lt;/strong&gt;事件中先行判斷點擊的是刪除按鈕，之後才接著執行刪除的SQL動作。&lt;/p&gt;&lt;br /&gt;&lt;div style=&quot;border-bottom: silver 1px solid; text-align: left; border-left: silver 1px solid; padding-bottom: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; padding-left: 4px; width: 97.5%; padding-right: 4px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; max-height: 200px; font-size: 8pt; overflow: auto; border-top: silver 1px solid; cursor: text; border-right: silver 1px solid; padding-top: 4px&quot; id=&quot;codeSnippetWrapper&quot;&gt;&lt;br /&gt;&lt;div style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot; id=&quot;codeSnippet&quot;&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #0000ff&quot;&gt;Protected&lt;/span&gt; &lt;span style=&quot;color: #0000ff&quot;&gt;Sub&lt;/span&gt; GridView_RowCommand(&lt;span style=&quot;color: #0000ff&quot;&gt;ByVal&lt;/span&gt; sender &lt;span style=&quot;color: #0000ff&quot;&gt;As&lt;/span&gt; &lt;span style=&quot;color: #0000ff&quot;&gt;Object&lt;/span&gt;, &lt;span style=&quot;color: #0000ff&quot;&gt;ByVal&lt;/span&gt; e &lt;span style=&quot;color: #0000ff&quot;&gt;As&lt;/span&gt; System.Web.UI.WebControls.GridViewCommandEventArgs) &lt;span style=&quot;color: #0000ff&quot;&gt;Handles&lt;/span&gt; GridView.RowCommand&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot;&gt;        &lt;span style=&quot;color: #0000ff&quot;&gt;If&lt;/span&gt; e.CommandName = &lt;span style=&quot;color: #006080&quot;&gt;&quot;Delete_VI&quot;&lt;/span&gt; &lt;span style=&quot;color: #0000ff&quot;&gt;Then&lt;/span&gt;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot;&gt;            &lt;span style=&quot;color: #0000ff&quot;&gt;Dim&lt;/span&gt; strSQL &lt;span style=&quot;color: #0000ff&quot;&gt;As&lt;/span&gt; &lt;span style=&quot;color: #0000ff&quot;&gt;String&lt;/span&gt;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot;&gt;            &lt;span style=&quot;color: #0000ff&quot;&gt;Dim&lt;/span&gt; Cmd &lt;span style=&quot;color: #0000ff&quot;&gt;As&lt;/span&gt; SqlCommand&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot;&gt;&amp;nbsp;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot;&gt;            &lt;span style=&quot;color: #0000ff&quot;&gt;Try&lt;/span&gt;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot;&gt;                strSQL = &lt;span style=&quot;color: #006080&quot;&gt;&quot;Delete 拜訪目的 Where 拜訪編號=@拜訪編號 &quot;&lt;/span&gt;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot;&gt;&amp;nbsp;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot;&gt;                Cmd = &lt;span style=&quot;color: #0000ff&quot;&gt;New&lt;/span&gt; SqlCommand(strSQL, conn)&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot;&gt;&amp;nbsp;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot;&gt;                Cmd.Parameters.Add(&lt;span style=&quot;color: #0000ff&quot;&gt;New&lt;/span&gt; SqlParameter(&lt;span style=&quot;color: #006080&quot;&gt;&quot;@拜訪編號&quot;&lt;/span&gt;, SqlDbType.Int))&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot;&gt;                Cmd.Parameters(&lt;span style=&quot;color: #006080&quot;&gt;&quot;@拜訪編號&quot;&lt;/span&gt;).Value = e.CommandArgument&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot;&gt;                Cmd.Connection.Open()&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot;&gt;                Cmd.ExecuteNonQuery()&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot;&gt;                Cmd.Cancel()&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot;&gt;                Cmd.Connection.Close()&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot;&gt;                conn.Dispose()&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot;&gt;&amp;nbsp;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot;&gt;                VI_GridView.DataBind()&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot;&gt;            &lt;span style=&quot;color: #0000ff&quot;&gt;Catch&lt;/span&gt; ex &lt;span style=&quot;color: #0000ff&quot;&gt;As&lt;/span&gt; Exception&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot;&gt;                Response.Write(ex.Message)&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot;&gt;            &lt;span style=&quot;color: #0000ff&quot;&gt;End&lt;/span&gt; &lt;span style=&quot;color: #0000ff&quot;&gt;Try&lt;/span&gt;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot;&gt;        &lt;span style=&quot;color: #0000ff&quot;&gt;End&lt;/span&gt; &lt;span style=&quot;color: #0000ff&quot;&gt;If&lt;/span&gt;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot;&gt;    &lt;span style=&quot;color: #0000ff&quot;&gt;End&lt;/span&gt; Sub&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;/div&gt;&lt;/div&gt;&lt;br /&gt;&lt;p&gt;其中，在SQL的Where條件使用了&lt;strong&gt;&lt;font color=&quot;#ff0000&quot;&gt;e.CommandArgument&lt;/font&gt;&lt;/strong&gt;來取得繫結在CommandArgument上的資料作為刪除條件，即可實現在GridView刪除點擊那一列的功能。&lt;br&gt;&lt;br&gt;&lt;font color=&quot;#0000ff&quot;&gt;&lt;strong&gt;補充：&lt;br&gt;&lt;/strong&gt;&lt;/font&gt;&lt;font color=&quot;#000000&quot;&gt;在ListView中使用&lt;strong&gt;CommandArgument&lt;/strong&gt;實現判斷Button點擊哪一列功能與GridView設定相同。唯一不同之處是ListView將Button的CommandName 傳遞至ItemCommand中，因此我們只需要將e.CommandArgument改寫在ItemCommand事件中即可。&lt;/font&gt;&lt;/p&gt;  </content><link rel='replies' type='application/atom+xml' href='http://tgw1029.blogspot.com/feeds/5832966238671638959/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://tgw1029.blogspot.com/2010/02/gridviewcommandargumentbuttonlistview.html#comment-form' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2893139382062216061/posts/default/5832966238671638959'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2893139382062216061/posts/default/5832966238671638959'/><link rel='alternate' type='text/html' href='http://tgw1029.blogspot.com/2010/02/gridviewcommandargumentbuttonlistview.html' title='GridView中使用CommandArgument取得Button按哪一列(ListView同樣適用)'/><author><name>威筆記</name><uri>http://www.blogger.com/profile/03781053564980189303</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://lh3.ggpht.com/_2sQfBxJU9mI/S4fXSkddpSI/AAAAAAAAL_A/wuuczMslJJo/s72-c/2010-02-26_213521_thumb%5B1%5D.jpg?imgmax=800" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2893139382062216061.post-9149955757000351916</id><published>2010-02-25T21:17:00.001+08:00</published><updated>2010-02-25T21:24:12.274+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Asp.Net"/><title type='text'>CodeBehind方式設定GridView欄寬、置中</title><content type='html'>&lt;p&gt;使用GridView中內建的編輯功能預設是沒有設定欄寬的，因此會造成編輯時的TextBox將欄位撐開的問題：&lt;br&gt;&lt;a href=&quot;http://lh4.ggpht.com/_2sQfBxJU9mI/S4Z4T_sqFDI/AAAAAAAAL-U/KHzm99S_tcM/s1600-h/2010-02-25_205559%5B3%5D.jpg&quot;&gt;&lt;img style=&quot;border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px&quot; title=&quot;2010-02-25_205559&quot; border=&quot;0&quot; alt=&quot;2010-02-25_205559&quot; src=&quot;http://lh5.ggpht.com/_2sQfBxJU9mI/S4Z4U7UHRGI/AAAAAAAAL-Y/5tNIGTNPrkM/2010-02-25_205559_thumb%5B1%5D.jpg?imgmax=800&quot; width=&quot;345&quot; height=&quot;123&quot;&gt;&lt;/a&gt; &lt;/p&gt; &lt;p&gt;&lt;br&gt;在GridView的&lt;strong&gt;RowDataBound&lt;/strong&gt;事件中以CodeBehind設定欄位寬度與文字置中：&lt;/p&gt; &lt;div style=&quot;border-bottom: silver 1px solid; text-align: left; border-left: silver 1px solid; padding-bottom: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; padding-left: 4px; width: 97.5%; padding-right: 4px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; max-height: 200px; font-size: 8pt; overflow: auto; border-top: silver 1px solid; cursor: text; border-right: silver 1px solid; padding-top: 4px&quot; id=&quot;codeSnippetWrapper&quot;&gt; &lt;div style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot; id=&quot;codeSnippet&quot;&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #0000ff&quot;&gt;Protected&lt;/span&gt; &lt;span style=&quot;color: #0000ff&quot;&gt;Sub&lt;/span&gt; GridView_RowDataBound(&lt;span style=&quot;color: #0000ff&quot;&gt;ByVal&lt;/span&gt; sender &lt;span style=&quot;color: #0000ff&quot;&gt;As&lt;/span&gt; &lt;span style=&quot;color: #0000ff&quot;&gt;Object&lt;/span&gt;, &lt;span style=&quot;color: #0000ff&quot;&gt;ByVal&lt;/span&gt; e &lt;span style=&quot;color: #0000ff&quot;&gt;As&lt;/span&gt; System.Web.UI.WebControls.GridViewRowEventArgs) &lt;span style=&quot;color: #0000ff&quot;&gt;Handles&lt;/span&gt; GridView.RowDataBound&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot;&gt;        &lt;span style=&quot;color: #008000&quot;&gt;&#39;設定欄位寬度&lt;/span&gt;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot;&gt;&amp;nbsp; GridView.Columns(1).ItemStyle.Width = 80&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot;&gt;        GridView.Columns(1).ControlStyle.Width = 80&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot;&gt;&amp;nbsp;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot;&gt;        &lt;span style=&quot;color: #008000&quot;&gt;&#39;設定文字置中&lt;/span&gt;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot;&gt;&amp;nbsp;&amp;nbsp; GridView.Columns(1).ItemStyle.HorizontalAlign = HorizontalAlign.Center&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot;&gt;    &lt;span style=&quot;color: #0000ff&quot;&gt;End&lt;/span&gt; Sub&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;/div&gt;&lt;/div&gt;&lt;br /&gt;&lt;p&gt;&lt;strong&gt;ItemStyle.Width&lt;/strong&gt;：普通模式欄位寬度&lt;br&gt;&lt;strong&gt;ControlStyle.Width&lt;/strong&gt; ：編輯模式欄位寬度&lt;br&gt;&lt;br&gt;設定後結果：&lt;br&gt;&lt;a href=&quot;http://lh5.ggpht.com/_2sQfBxJU9mI/S4Z4Vms8m_I/AAAAAAAAL-c/qGzgS-iH1Mc/s1600-h/2010-02-25_205627%5B3%5D.jpg&quot;&gt;&lt;img style=&quot;border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px&quot; title=&quot;2010-02-25_205627&quot; border=&quot;0&quot; alt=&quot;2010-02-25_205627&quot; src=&quot;http://lh3.ggpht.com/_2sQfBxJU9mI/S4Z4WnRGTVI/AAAAAAAAL-g/Hj_c3tAFgB4/2010-02-25_205627_thumb%5B1%5D.jpg?imgmax=800&quot; width=&quot;276&quot; height=&quot;123&quot;&gt;&lt;/a&gt;&amp;nbsp;&lt;br&gt;&lt;br&gt;&lt;font color=&quot;#0000ff&quot;&gt;&lt;strong&gt;補充：&lt;br&gt;&lt;/strong&gt;&lt;/font&gt;&lt;font color=&quot;#000000&quot;&gt;以For迴圈方式設定GridView中所有欄位寬度&lt;/font&gt;&lt;/p&gt;&lt;br /&gt;&lt;div style=&quot;border-bottom: silver 1px solid; text-align: left; border-left: silver 1px solid; padding-bottom: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; padding-left: 4px; width: 97.5%; padding-right: 4px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; max-height: 200px; font-size: 8pt; overflow: auto; border-top: silver 1px solid; cursor: text; border-right: silver 1px solid; padding-top: 4px&quot; id=&quot;codeSnippetWrapper&quot;&gt;&lt;br /&gt;&lt;div style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot; id=&quot;codeSnippet&quot;&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #0000ff&quot;&gt;Protected&lt;/span&gt; &lt;span style=&quot;color: #0000ff&quot;&gt;Sub&lt;/span&gt; GridView_RowDataBound(&lt;span style=&quot;color: #0000ff&quot;&gt;ByVal&lt;/span&gt; sender &lt;span style=&quot;color: #0000ff&quot;&gt;As&lt;/span&gt; &lt;span style=&quot;color: #0000ff&quot;&gt;Object&lt;/span&gt;, &lt;span style=&quot;color: #0000ff&quot;&gt;ByVal&lt;/span&gt; e &lt;span style=&quot;color: #0000ff&quot;&gt;As&lt;/span&gt; System.Web.UI.WebControls.GridViewRowEventArgs) &lt;span style=&quot;color: #0000ff&quot;&gt;Handles&lt;/span&gt; GridView.RowDataBound&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot;&gt;        &lt;span style=&quot;color: #0000ff&quot;&gt;Dim&lt;/span&gt; i &lt;span style=&quot;color: #0000ff&quot;&gt;As&lt;/span&gt; &lt;span style=&quot;color: #0000ff&quot;&gt;Integer&lt;/span&gt;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot;&gt;        &lt;span style=&quot;color: #0000ff&quot;&gt;For&lt;/span&gt; i &lt;span style=&quot;color: #0000ff&quot;&gt;As&lt;/span&gt; &lt;span style=&quot;color: #0000ff&quot;&gt;Integer&lt;/span&gt; = 0 &lt;span style=&quot;color: #0000ff&quot;&gt;To&lt;/span&gt; GridView.Columns.Count - 1&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot;&gt;            GridView.Columns(i).ItemStyle.Width = 80&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot;&gt;        &lt;span style=&quot;color: #0000ff&quot;&gt;Next&lt;/span&gt;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #0000ff&quot;&gt;End&lt;/span&gt; Sub&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;/div&gt;&lt;/div&gt;  </content><link rel='replies' type='application/atom+xml' href='http://tgw1029.blogspot.com/feeds/9149955757000351916/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://tgw1029.blogspot.com/2010/02/codebehindgridview.html#comment-form' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2893139382062216061/posts/default/9149955757000351916'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2893139382062216061/posts/default/9149955757000351916'/><link rel='alternate' type='text/html' href='http://tgw1029.blogspot.com/2010/02/codebehindgridview.html' title='CodeBehind方式設定GridView欄寬、置中'/><author><name>威筆記</name><uri>http://www.blogger.com/profile/03781053564980189303</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://lh5.ggpht.com/_2sQfBxJU9mI/S4Z4U7UHRGI/AAAAAAAAL-Y/5tNIGTNPrkM/s72-c/2010-02-25_205559_thumb%5B1%5D.jpg?imgmax=800" height="72" width="72"/><thr:total>0</thr:total></entry></feed>