all groups > dotnet academic > june 2004 >
You're in the

dotnet academic

group:

Prob. updating a label..


Prob. updating a label.. Svein Erik Storkaas
6/19/2004 8:20:20 AM
dotnet academic: Hi,
I have a page that has 1 textbox, 1 button and 1 label. It is a page where
you have to write your email address, then you can click on the button to
download a program. When the button is clicked it updates a downloadcounter
I have made. All works fine except it wont update the textlabel that shows
the current number of the counter. If I refresh the page, it updates.

I know that i can use onPreRender in a way...but I am wondering if it gets
"destroyed" when i use a Response.Redirect("pathtothe-file")..?

The problem is: How can i get the label updated after the buttonclick?

I would REALLY appreciate a solution to my problem! :)
Here is a sample of the code i use:

private void cmdDownload_Click(object sender, System.EventArgs e)
{
int currentCounter;
string email;

email = txtEmail.Text;
insEmailAddress(email);
currentCounter = getCounter();
updateCounter(currentCounter);
currentCounter = getCounter();

//I have tried to place it both before and after the
Response.Redirect
updateLabel(currentCounter);

Response.Redirect("http://something_1.1.zip",false);
}

Re: Prob. updating a label.. tehwinz
6/24/2004 11:05:13 AM


try

currentCounter.DataBind()

after you assign the new data to your counter

On Sat, 19 Jun 2004 08:20:20 +0200, "Svein Erik Storkaas"
[quoted text, click to view]
AddThis Social Bookmark Button