Problem updating a label

  • Thread starter Svein Erik Storkaas
  • Start date
S

Svein Erik Storkaas

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);
}
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,431
Messages
2,571,677
Members
48,796
Latest member
Greg L.

Latest Threads

Top