Click here to Skip to main content
15,917,455 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have a function to write something in my webpage:
ex:
Response.Write(str); 

but every time the page run the previous data is still there.

How can i clear the previous data.

I use
Response.Clear() 
but not working.

Please help me.

Thanks in Advance.
Posted
Updated 19-May-11 0:32am
v2
Comments
R. Giskard Reventlov 19-May-11 6:34am    
How are you populating the initial data?
rahul dev123 19-May-11 6:49am    
I have set value in my string str variables then it show in web page

From what you have said it sounds like you are setting the initial value, probably in the Page_Load event.

You should enclose the default values something like:

if (!IsPostBack)
{
    Label1.Text = value;
}


Now when you click a button and postback the new value will appear as the initial value is only set the first time you enter the page.
 
Share this answer
 
Comments
rahul dev123 19-May-11 7:02am    
i have function like this:
if (act == "getpendingS3")
{
string response = S3DetailsClass.getS3details(0);
Response.Write(response);
}
if (act == "getcompletedS3")
{
//Response.Clear();
string response = S3DetailsClass.getS3details(1);
Response.Write(response);
//Response.End();
}
data will be display according to the request function by the user but if we call first function then its ok next time when i get call the second function then previous function data is also display
This Tip: Simple and easy way to clear all the input fields in the form.[^] should help you out in clearing the controls of the webpage.
 
Share this answer
 

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