473,385 Members | 1,693 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

How to make VS create a page_init (c#)

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
May 27 '06 #1
1 6062
..SingLu" <su@yahoo.com> wrote in message
news:OE**************@TK2MSFTNGP02.phx.gbl...
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
May 28 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

9
by: wASP | last post by:
Hello again to all of you geniuses, I'm having a problem trying to load dynamic controls at the initialization phase. I've read the docs, and I thought I had it figured out:...
4
by: Craig Buchanan | last post by:
If I set a ViewState variable in the page_load event, then try to access that same ViewState variable in the Page_Init event *after* a postback, the variable's value is different. I only set it in...
6
by: Dot net work | last post by:
I've read quite a few threads on these groups about this. When someone says the following: "My Page_Load gets called twice on a button click postback" The replies are: "Do you have...
4
by: awalker1 | last post by:
Hi all, I have a datagrid and a drop down list on my page. The DataGrid is created dynamically at runtime to contain columns based on the item that the user has selected from the drop down...
12
by: Nathan Sokalski | last post by:
What is the difference between the Page_Init and Page_Load events? When I was debugging my code, they both seemed to get triggered on every postback. I am assuming that there is some difference,...
6
by: ad | last post by:
Hi, What is the difference between Page_init and Page_Load event?
13
by: Daniel Walzenbach | last post by:
Hi, Imagine the following situation: I have an asp.net application which allows uploading files to a SQL Server 2000 database (Files are stored as type "images"). As a next step I would like to...
0
by: Fabuloussites | last post by:
I have a user control that i need to do some processing in a fuction when it is first loaded. I have tried to add my code to the page_load and page_init fuctions. when i run a debugger, i notice...
2
by: =?Utf-8?B?cm9kY2hhcg==?= | last post by:
hey all, Is OnInit and Page_Init the same thing? thanks, rodchar
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.