If you are recently moving from VB.NET to C#, then one thing you may have noticed is how many different features that you had in VB.NET IDE are now missing in the C# IDE. One such missing feature is the Page Events in the dropdown when you are the code view mode. You will notice that in a new blank webform (.aspx page) the Page_Load event is visible, but the Page_PreRender and other events are not ? How do you get to them ?
If you are in Visual Studio 2003 then
- Go to the Design View for the .aspx page.
- Press F4 to view properties.
- From the dropdown of the properties page, choose the class name of your aspx page.
- Click the lightening Icon below the class name.
- In the list, below Load, you will see PreRender.
- Type in a name next to the PreRender. This will be the name for the PreRender event.
- Press Enter.
- The event will open in the IDE and add a handler for the event in the Web Form Designer generated code.
If you are in a Visual Studio 2005 Master Page then
- Go to the Design View for the .aspx page.
- Click the ContentPlaceholder1 on the page to select it.
- Press F4 to view properties.
- The ContentPlaceholder1 will be already selected in the dropdown and the lightening Icon will be enabled.
- In the list of events below Load, you will see PreRender.
- Type in a name next to the PreRender. This will be the name for the PreRender event.
- Press Enter.
- The event will open in the IDE and add a handler for the event in the Web Form Designer generated code.







1456
i am using master-content feature of Visual Studio 2005. I am not able to see the page render event as mentioned above. Infact i am not able to see class name of the aspx page in the properties dropdown. Please Advice
1457
ilankuzhali, I have just updated the post to show you how to do this with a Master Page in VS2005. Hope this helps !
1453
I am NOT using Master pages, just a regular web form in ASP.NET 2.0 using VS 2005. Where do I find the evnts such as Page_Prerender?
1455
why would microsoft remove all events for the page but the page_load in vs2005 if pre_render has to be used. that is just simply idiotic.
1454
I’m using Visual Web Developer 2005. I am not getting the Page_PreRender Event.
How to get the event, please help
1452
VS 2005:
Right-click your .aspx file in Solution Explorer, and choose “View Component Designer”.
Click somewhere on the window that comes up and choose “Properties”. You will see the list of events, as properties of the web form. To create the stub code, just double-click in the blank area to the right of the desired event, in the Properties window.
1450
You are great!
1451
Thanks for the Hint Milo…
Very Nice
1460
I am still unable to get content pages pre_init event pleaz help me how can i get the pre_init event on my content page
1458
ur suggetion is good what i want prerender without master page i m using .net05
1459
Why is it so complicated to get to the events? Isn’t is easy just to make a selection from dropdown menu. For what the dropdown menu is there? Incredible!!! Right here I miss VB.NET.
1534
bloody Microsoft, can’t fix the simple things, yet they are releasing version 2008, 2010, 2020, Trillenium, 3010… etc.
1551
Thanks heaps Milo