Click here to Skip to main content
15,077,641 members
Please Sign up or sign in to vote.
5.00/5 (1 vote)
Hello,

I want to clear server side asp .net textbox after data submit using c# asp.net,
but my textbox data,It's clearing only client end but server side end it's not clearing, when I postback my page so, value is also still in server end and add in my current value.

I did not define any Session and View State for this TextBox.

So, please help me.
How can we clear data from server side textbox?

Thanks in Advance.

Ankit Agarwal
Website Developer
Posted
Updated 5-Jan-14 23:41pm
v4
Comments
Karthik_Mahalingam 6-Jan-14 6:46am
   
post your code.

C#
protected void Page_Load(object sender, EventArgs e)
   {
       if(IsPostBack)
       {
           TextBox1.Text = "";
       }
   }

Try this.
   
In your submit button click , after doing the submit operations add

TextBox1.Text=String.Empty;
   

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)




CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900