close
Blogtrottr
Yahoo!奇摩知識+ - 分類問答 - 電腦網路 - 已解決
Yahoo!奇摩知識+ - 分類問答 - 電腦網路 - 已解決 
Try New Relic at no charge

Deploy New Relic and get your Nerd Life t-shirt. Monitor your Ruby, PHP, Python, Java and .NET web apps in less than 2 minutes.
From our sponsors
textbox設為password,回傳後消失?
Sep 8th 2013, 11:55

如同您說的
TextBox設定  TextMode = Password之後

搭配 AutoPostBack = true 與 TextChanged事件
來檢查、來做密碼再度確認的功能

的確會在PostBack之後消失

我做了幾個範例:

TextBox的 TextMode屬性設為Password,AutoPostBack會清空密碼欄位?
www.dotblogs.com.tw/mis2000lab/archive/2013/05/29/textbox_textmode_autopostback_20130529.aspx

希望對您有幫助。

解    法:
(1),  不設定 AutoPostBack,就會變成 Button來啟動 / Submit資料,
   這時候 TextBox2的 TextChanged事件一樣會執行(會等到您按下 Button才執行),一樣會檢查密碼兩者是否符合?
 
(2). 改用「驗證控制項」
  CompareValidator,可以驗證兩個輸入欄位(TextBox)是否相等?
  Operator屬性,設定為 Equal即可。.............這是預設值,所以不用設定。
  <asp:CompareValidator ID="CompareValidator1" runat="server" ControlToCompare="TextBox1" ControlToValidate="TextBox2"
    ErrorMessage="CompareValidator驗證控制項!(密碼輸入錯誤)" ForeColor="Red"></asp:CompareValidator>

 
 
(3). ASP.NET AJAX (UpdatePanel)

This entry passed through the Full-Text RSS service — if this is your content and you're reading it on someone else's site, please read the FAQ at fivefilters.org/content-only/faq.php#publishers. Five Filters recommends:

You are receiving this email because you subscribed to this feed at blogtrottr.com.

If you no longer wish to receive these emails, you can unsubscribe from this feed, or manage all your subscriptions
arrow
arrow
    全站熱搜
    創作者介紹
    創作者 kgkxdxbhfatzm 的頭像
    kgkxdxbhfatzm

    吳依潔三圍, 吳依潔無名, 吳依潔facebook, 吳依潔男友, 中天主播吳依潔, 主播吳依潔, 吳依潔整形前

    kgkxdxbhfatzm 發表在 痞客邦 留言(0) 人氣()