Note that there are some explanatory texts on larger screens.

plurals
  1. POText box getting cleared because of update panel
    primarykey
    data
    text
    <p>I've have one table, in that table within one I've one and within that , I've <strong>update panel</strong> whose update mode is set to <strong>conditional</strong>. Within this update panel I've another <strong>table</strong>. The table contains 3 text boxes as: old password, new password and confirm password. On the <strong>textChanged</strong> event of the old password I am checking the user entered value with the value in db. But when the function completes its execution all the 3 text boxes looses its values regardless of whether I update the update panel or not. I don't know why it clears text boxes. I want to prevent text boxes from getting cleared. I tried to get the text box text in string variable and again assign it to text boxes (both in text box text changed event and in page load event under isPostBack condition) but its too, not working. </p> <p><strong>asp code:</strong> </p> <pre><code>. . . &lt;tr&gt; &lt;td colspan="3"&gt; &lt;div&gt; &lt;asp:UpdatePanel ID="updPnlChngPwd" runat="server" UpdateMode="Conditional"&gt; &lt;ContentTemplate&gt; &lt;table style="width:100%"&gt; &lt;tr&gt; &lt;td&gt; Old Password &lt;/td&gt; &lt;td&gt;:&lt;/td&gt; &lt;td&gt; &lt;asp:TextBox ID="txtOldPwd" runat="server" Height="21px" MaxLength="50" TextMode="Password" Width="60%" ontextchanged="txtOldPwd_TextChanged" AutoPostBack="True"&gt;&lt;/asp:TextBox&gt; &lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td&gt;&lt;/td&gt; &lt;td&gt;&lt;/td&gt; &lt;td&gt; &lt;asp:Label ID="lblWrongOldPwd" runat="server" Text="Wrong Old Password" ForeColor="Red" Visible="False"&gt;&lt;/asp:Label&gt; &lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td&gt; Password &lt;/td&gt; &lt;td&gt;:&lt;/td&gt; &lt;td&gt;&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td&gt;&lt;/td&gt; &lt;td&gt;:&lt;/td&gt; &lt;td&gt; &lt;asp:TextBox ID="txtSuppRePwd" runat="server" Height="21px" MaxLength="50" TextMode="Password" Width="60%"&gt;&lt;/asp:TextBox&gt; &lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td&gt;&lt;/td&gt; &lt;td&gt; &lt;asp:Button ID="btnUpdPwd" runat="server" Text="Change Password" onclick="btnUpdPwd_Click"/&gt;&lt;/td&gt; &lt;td&gt; &lt;/td&gt; &lt;/tr&gt; &lt;/table&gt; &lt;/ContentTemplate&gt; &lt;/asp:UpdatePanel&gt; &lt;/div&gt; &lt;td&gt; &lt;/tr&gt; . . . </code></pre> <p><strong>C# code for tetxt box textChanged event:</strong> </p> <pre><code>protected void txtOldPwd_TextChanged(object sender, EventArgs e) { DataTable dtOldPwd = Obj.DBAccess("select Pwd from Customer where Cust_Id = " + Convert.ToInt32(Session["SuppID"]) + " and Supp_Pwd = '" + txtOldPwd.Text + "'"); if (dtOldPwd.Rows.Count == 1) { lblWrongOldPwd.Visible = false; } else { lblWrongOldPwd.Visible = true; updPnlChngPwd.Update(); } } </code></pre> <p>Now I am not able to understand what exactly wrong I am doing, does having update panel inside the table causing problem?</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload