private int myId = 1;
private void Page_Load(object sender, System.EventArgs e)
{
if (myId == 1)
{
btnTitle.Text = "First button";
}
if (myID == 2)
{
btnTitle.Text = "Second button";
}
}
Don't know why. Did I miss anything here?
Thanks.Look for the InitializeComponent method. (If using VS.NET, it may be hidden due to the outlining feature.)
It should contain:
private void InitializeComponent()
{
this.Load += new System.EventHandler(this.Page_Load);
// other code
}
If its missing, add it back. Some versions of VS.NET have a bug that occassionally delete this and other event handlers in this very important setup method.
0 comments:
Post a Comment