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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

newbie - how to call a method from event handler

Status
Not open for further replies.

AdamSpattam

Technical User
May 21, 2010
4
0
0
US
below(simplified) in page load i call restoreContents();...it does not complain on that line as i debug but never goes to the method. what is my syntax/approach problem.
tanx in advance


protected void Page_Load(object sender, EventArgs e)
{
if (this.IsPostBack)
{
//restore variables.
contents = (string)ViewState["contents"];
restoreContents();
}
}

}

public void restoreContents()
{
//restore contents from member vairable to textbox
txtValue.Text = contents;
}



 
Are you stepping INTO the code or OVER the code ? Stepping OVER bypasses the method.

HTH

Chew


10% of your life is what happens to you. 90% of your life is how you deal with it.
 
i don't see any immediate issues on your code. But expect the restoreContents() method won't be called the first time you run the page (IsPostBack = false) ;)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top