<output id="qn6qe"></output>

    1. <output id="qn6qe"><tt id="qn6qe"></tt></output>
    2. <strike id="qn6qe"></strike>

      亚洲 日本 欧洲 欧美 视频,日韩中文字幕有码av,一本一道av中文字幕无码,国产线播放免费人成视频播放,人妻少妇偷人无码视频,日夜啪啪一区二区三区,国产尤物精品自在拍视频首页,久热这里只有精品12

      關(guān)于ASP.NET的只言片語[2008.8.12最后更新]

      ASP.NET  在學(xué)習(xí)的過程中,總是會有一些細節(jié)的問題,它很小,也很容易解決,但有時候它還真的挺有用,于是,便產(chǎn)生了寫此隨筆的念頭。這將是一篇不斷更新的隨筆,記錄一些平常碰到的ASP.NET的“小”問題。

        

      1. 問題:一個頁面,它有一個TextBox,還有一個RequiredFieldValidator驗證控件(Text="...不能為空"),頁面中還有一個退出按鈕(服務(wù)器控件,OnClick="Logout")。在點擊“退出”按鈕時,RequiredFieldValidator驗證控件會起作用,顯示“...不能為空”,請求無法回傳,也就導(dǎo)致了不能退出。[2008.6.10]

      解決辦法:設(shè)置“退出”按鈕的屬性:CausesValidation="false"

      2. 為什么一旦瀏覽器不啟用Cookie,Session也不能用,不是說Session是保存在服務(wù)器么?[2008.8.6]

      答:When you use Session state, a session cookie named ASP.NET_SessionId is added to your browser automatically. This cookie contains a unique identifier. It is used to track you as you move from page to page.When you add items to the Session object, the items are stored on the web server and not the web browser. The ASP.NET_SessionId cookie is used to associate the correct data with the correct user. (A session cookie exists only in memory. If a user closes the web browser, the session cookie disappears forever).

      -- Stephen Walther 《ASP.NET 2.0 Unleashed》

      3. Session事件注意點[2008.8.6]:
      The Session End event is not raised by all session store providers. The event is raised by the InProc session store provider (the default provider), but it is not raised by the StateServer or SQLServer state providers.

      -- Stephen Walther 《ASP.NET 2.0 Unleashed》

      4. Cookieless Session的注意點[2008.8.6]:

      When you enable cookieless session state, you should also enable this attribute because it can help prevent users from inadvertently sharing session state.

      <sessionState cookieless="AutoDetect" regenerateExpiredSessionId="true" />

      -- Stephen Walther 《ASP.NET 2.0 Unleashed》

      5. 關(guān)于HttpServerUtility.Execute(string path, TextWriter writer, bool preserveForm)方法中的preserveForm參數(shù)[2008.8.6]:

      如果將此參數(shù)設(shè)為true,則會把傳給本頁面的querystring和request.form中的信息傳給被Excute的那個頁面,比如本頁地址為Default.aspx?p=5,頁中有代碼:Server.Execute("Default2.aspx", sw, true),sw是StringWriter的實例,那么,頁面Default2.aspx中就可以通過Request.QueryString["p"]得到5,反之,如果把preserveForm設(shè)為false,則Default2.aspx中就取不到url參數(shù)p的值。

       

      6. 在Visual Studio中編寫皮膚文件(*.skin)時沒有智能感知?[2008.8.10]

      答:是可以設(shè)置的,在VS中Tools --> Options --> Text Editor --> File Extension, 在右側(cè)的Extension中添加skin,然后選擇User Control Editor,確定,然后關(guān)掉*.skin文件再打開就行了,圖如下:

       

      7. 自定義異常不要從ApplicationException繼承,而要從Exception繼承:[2008.8.12]

      這點放在這篇文章里或許不是太合適,但現(xiàn)在沒地兒可放,就先擱這兒了。這點用Krzysztof Cwalina和Jeffery Richter的話來解釋:

      Jeffery Richter: System.ApplicationException is a class that should not be part of the .NET Framework. The original idea was that classes derived from SystemException would indicate exceptions thrown from the CLR (or system) itself, whereas non-CLR exceptions would be derived from ApplicationException. However, a lot of exception classes didn’t follow this pattern. For example, TargetInvocationException (which is thrown by the CLR) is derived from ApplicationException. So, the ApplicationException class lost all meaning. The reason to derive from this base class is to allow some code higher up the call stack to catch the base class. It was no longer possible to catch all application exceptions.

      Krzysztof Cwalina: Today, somebody asked me whether they should go through their code-base and remove all references to the exception. I answered that it’s not worth the effort. “ApplicationException is not considered harmful, just useless.

      posted @ 2008-06-10 20:04  水言木  閱讀(410)  評論(0)    收藏  舉報
      主站蜘蛛池模板: 国产成人av电影在线观看第一页| 人人妻碰人人免费| 国产午夜精品福利91| 波多野结衣的av一区二区三区 | 国产精品国产三级国产an| 麻豆国产传媒精品视频| 国产精品国产精品偷麻豆| 欧美乱妇高清无乱码免费| 久久精品国产91精品亚洲| 起碰免费公开97在线视频| 性男女做视频观看网站| 武功县| 九九视频热最新在线视频| 永川市| 竹菊影视欧美日韩一区二区三区四区五区 | 元谋县| 国产精品99久久久久久www| 激情五月开心综合亚洲| 成人免费无遮挡在线播放| 亚洲激情一区二区三区视频| 国产精品一区在线蜜臀| 最新中文字幕av无码专区不| 国产精品午夜福利精品| 宾川县| 亚洲精品天堂在线观看| 97人妻蜜臀中文字幕| 国产一区二区高清不卡| 夜夜春久久天堂亚洲精品| 内射极品少妇xxxxxhd| 久久精品国产88精品久久| 久久精品伊人波多野结衣| 午夜成人精品福利网站在线观看| 99久久久无码国产麻豆| 免费的特黄特色大片| 激情综合五月| 中文字幕国产精品日韩| 国产精品天天在线午夜更新| 年轻女教师hd中字3| 动漫精品中文字幕无码| 视频二区中文字幕在线| 一区二区不卡99精品日韩|