Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > How to make VS create a page_init (c#)

Reply
Thread Tools

How to make VS create a page_init (c#)

 
 
SingLu
Guest
Posts: n/a
 
      05-27-2006
I'm going nuts here. I'm using VS2005 and C# and would like to create a
simple page and use the page_init-event. I add a new page but can't find a
way to make VS add a eventhandler. If I dbl.click the page I get a page_load
method - but I want to see a list of possible events (including page_init).
If a select the document and look in the property-window theres no "flash"
to show me a list of events (like there is where using a control). Its so
easy in VB - how is it done in c#?

Thanks


 
Reply With Quote
 
 
 
 
Chris Jobson
Guest
Posts: n/a
 
      05-28-2006
..SingLu" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> I'm going nuts here. I'm using VS2005 and C# and would like to create a
> simple page and use the page_init-event. I add a new page but can't find a
> way to make VS add a eventhandler. If I dbl.click the page I get a
> page_load method - but I want to see a list of possible events (including
> page_init). If a select the document and look in the property-window
> theres no "flash" to show me a list of events (like there is where using a
> control). Its so easy in VB - how is it done in c#?


It appears that all you have to do is add an appropriately-named method
(e.g. Page_Init, Page_PreRender, etc.) with the correct signature to the
code-behind file and it will be automatically invoked. In my case I wanted
to handle PreRender and I added the method:
protected void Page_PreRender(object sender, EventArgs e)
{
...
}
and it just worked! However, it seems EXTREMELY bizarre to me that there is
no nice way to get a list of the possible events and to name the handler
whatever you like.

Chris Jobson


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: How include a large array? Edward A. Falk C Programming 1 04-04-2013 08:07 PM
Page_Load or Page_Init Patrick Kristiansen ASP .Net 0 03-05-2004 06:26 PM
Using inheritance for web pages - why have a Page_Init when you can override OnInit? ASP .Net 2 07-16-2003 07:32 PM
Page_Init() and Page_Load() Christian ASP .Net 1 07-16-2003 07:28 PM
Using inheritance for web pages - why have a Page_Init when you can override OnInit? ASP .Net 2 07-13-2003 04:07 AM



Advertisments