How can I get Page PreRender to work?
-
Maybe I'm going mad but I just can't get the PreRender method to fire on a web page. I'm using VS2005 and have created a blank website and have right clicked on the default.aspx page and selected 'View Component Designer' and from there selected the thunderbolt and double clicked PreRender. This created the PreRender method in the 'code behind' and also hooked it up in the InitializeComponent method. If I just put a simple statement in the PreRender method to set the value of a label for example it does not fire. Also, if I put a debug mark in the PreRender method it does not fire. What's going on?
-
Maybe I'm going mad but I just can't get the PreRender method to fire on a web page. I'm using VS2005 and have created a blank website and have right clicked on the default.aspx page and selected 'View Component Designer' and from there selected the thunderbolt and double clicked PreRender. This created the PreRender method in the 'code behind' and also hooked it up in the InitializeComponent method. If I just put a simple statement in the PreRender method to set the value of a label for example it does not fire. Also, if I put a debug mark in the PreRender method it does not fire. What's going on?
it's working Fine. :)
protected void Page_PreRender(object sender, EventArgs e) { Button1.Text = "Hi Abhijit"; }
cheers, Abhijit
-
it's working Fine. :)
protected void Page_PreRender(object sender, EventArgs e) { Button1.Text = "Hi Abhijit"; }
cheers, Abhijit
I have the same signature but it still isn't firing. This is the code in my page.
private void InitializeComponent() { this.PreRender += new System.EventHandler(this.\_Default\_PreRender); } private void \_Default\_PreRender(object sender, EventArgs e) { Label1.Text = "hi"; }
-
I have the same signature but it still isn't firing. This is the code in my page.
private void InitializeComponent() { this.PreRender += new System.EventHandler(this.\_Default\_PreRender); } private void \_Default\_PreRender(object sender, EventArgs e) { Label1.Text = "hi"; }
Are you on ASP.NET 1.1 ? From where this
InitializeComponent()
is getting called ?All C# applications should call Application.Quit(); in the beginning to avoid any .NET problems.- Unclyclopedia How to use google | Ask smart questions