Unable to clear a textbox in Firefox

Posted by Sharpcnet under ASP.NET on 1/6/2014 | Points: 10 | Views : 734 | Status : [Member] | Replies : 2
txtName is the first control in the page. When the page loads initially, it is empty. If there is text in the textbox and the user clicks on Refresh, it is not clearing the text.
At debug, i can see the textbox being cleared, but on page it isnt!!!!.
This happens in Firefox. Works fine in IE.

I have tried , Keeping the textbox outside the updatepanel, enveloping another updatepanel for this textbox alone, Enabling the viewstate, and also removing the clientidmode property.

ASPX:
<asp:UpdatePanel ID="UpdatePanel1" runat="server" UpdateMode="Conditional">
<Triggers>
<asp:AsyncPostBack ControlID="txtName" EventName="TextChanged"/>
</Triggers>
<ContentTemplate>

<asp:TextBox ID="txtName" runat="server" OnTextChanged="txtName_TextChanged"
EnableviewState="false" ClientIDMode="Static">
</asp:TextBox>

//Some other controls

</ContentTemplate>
</asp:UpdatePanel>

C#
protected void page_load()
{
if(!IsPostBack)
{
txtName.Text="";
UpdatePanel1.Update();
}
}





Responses

Posted by: kgovindarao523-21772 on: 1/6/2014 [Member] [MVP] Bronze | Points: 25

Up
0
Down
Hi,

you may try like this:
Clear all browsing history(including cookies,caching data) in firefox and restart it.

Thank you,
Govind

Sharpcnet, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Allemahesh on: 1/6/2014 [Member] [MVP] Silver | Points: 25

Up
0
Down
Hi, this is the browser issue. Jut ignore it. If you want to clear it then use the JavaScript or Jquery.

Sharpcnet, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response