Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

web application button clicked before its clicked

Status
Not open for further replies.

Chrissirhc

Programmer
May 20, 2000
926
GB
Hi,

I've created a very simple aspx page with c# behind it. Now I load the page and the code that happens when you click the button happens before I've clicked the button. It happens when the page loads.

Why is this?

Thanks

Chris
 
It shouldn't if you've put the code in the right place. Can you provide your code so we can see?
 
private void Page_Load(object sender, System.EventArgs e)
{
// Put user code to initialize the page here
//set up the connection object
CheckSetConnection();
this.TextBox1.Text = myConnection.ToString();


}

private void Button1_Click(object sender, System.EventArgs e)
{
//When the button is clicked we call the ContributionCheck method which checks all the contributions and takes the appropriate action
ContributionCheck();
this.TextBox1.Text = myConnection.State.ToString(); //"something here -->";
ContributionCheckChangeColour(GREEN);
}

Thats it.
 
Because I am using some form. I think the program is holding its state in the form until I close down the browser. Is this correct thinking?

Cheers,

Chris
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top