472,354 Members | 1,185 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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

page events in C# INIT-LOAD-PRE-RENDER

Hi colleagues,

how are the page events handled in C#? In VB you have the handles
keyword. and in C# all the params (object and EventArgs ) are the same
for 3 eventhandlers below.
a- How does the framework know which one is page_load, and which one
is PreRender?
Is it because of the name?
b- If I would like to add these events in C# code behind, what is the
trick. I just copy and paste it. In VB you can select from
dropdownlistboxes?

thanks for any advice,

cheers,
mesut
(1)
protected void Page_PreRender(object sender, EventArgs e)
//--------------------------------------------------------------------------
{
do somethig
}
(2)
//--------------------------------------------------------------------------
protected void Page_Load(object sender, EventArgs e)
{
do something
}
(3)
protected void Page_Init(object sender, EventArgs e)
{
}

Oct 4 '07 #1
3 36822
Hello mesut,

Firstly, this question is more appropriate to asp.net group

ma- How does the framework know which one is page_load, and which one
mis PreRender? mIs it because of the name?

each page in asp.net 2.0 has the AutoEventWireup tag set to true, which means
that all this page event initialization are made explicitly for u.

mb- If I would like to add these events in C# code behind, what is the
mtrick. I just copy and paste it. In VB you can select from
mdropdownlistboxes?

just select the page or the control and set the handler for the desired event
in the properties manually
---
WBR,
Michael Nemtsev [.NET/C# MVP] :: blog: http://spaces.live.com/laflour

"The greatest danger for most of us is not that our aim is too high and we
miss it, but that it is too low and we reach it" (c) Michelangelo
Oct 4 '07 #2
Hi Michael,

sorry if it was wrong group. I just started learning C# and I thought
I could post the question to this group because of C#, but you're
right it's more asp.net question.
your first answer: but how does the system now
that this protected void Page_PreRender(object sender, EventArgs e)
is PAGE_PRERENDER
and this is protected void Page_Load(object sender, EventArgs e) is
PAGE LOAD
etc.
is it because of the name?

thanks for your answers. If you don't answer no harm. thanks anyway...
I'll post it to other group then.

cheers, mesut

Oct 4 '07 #3
Hello mesut,

have u read this http://msdn2.microsoft.com/en-us/lib...entwireup.aspx
?

---
WBR,
Michael Nemtsev [.NET/C# MVP] :: blog: http://spaces.live.com/laflour

"The greatest danger for most of us is not that our aim is too high and we
miss it, but that it is too low and we reach it" (c) Michelangelo
mHi Michael,
m>
msorry if it was wrong group. I just started learning C# and I thought
mI could post the question to this group because of C#, but you're
mright it's more asp.net question.
myour first answer: but how does the system now
mthat this protected void Page_PreRender(object sender, EventArgs e)
mis PAGE_PRERENDER
mand this is protected void Page_Load(object sender, EventArgs e) is
mPAGE LOAD
metc.
mis it because of the name?
mthanks for your answers. If you don't answer no harm. thanks
manyway... I'll post it to other group then.
m>
mcheers, mesut
m>
Oct 4 '07 #4

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

Similar topics

3
by: Jack Wright | last post by:
Dear All, I would like to disable the Refresh events like (F5, Ctrl+R, RightClick Mouse + Refresh, Ctrl+N)... I have been able to solve F5 and RightClick Mouse + Refresh...how to I trap or ignore...
1
by: Jarek | last post by:
Hi! I have a page containing datagrid. When datagrid is edited there is a calendar. When I change the date for the first time all page events are executed twice and: when they are executed for...
2
by: Josh | last post by:
Anyone know what the Page_AbortTransaction and Page_CommitTRansaction events are for? Are they used by some kind of built in data binding?
0
by: richard.haber | last post by:
I have a situation where there are two controls on the master page: a tree with a menu structure (whose content and structure is customizable by each user) and a menu control which displays the...
2
by: Jason | last post by:
A co worker of mine pointed out that we were missing the page level event properties icon (aka the lightening bolt). This is vs.net 2005 and if I open a web page in design mode apparently there...
3
by: =?Utf-8?B?VDhS?= | last post by:
Ok...I've been looking for an answer to this problem and can't seem to find one...Framework 1.1 mind you. I have a base class that inherits from UserControl. I have 5 and soon to be 12 user...
1
by: Lit | last post by:
Hi, How to hook to the Page events like PreRender. in C# I need to just add the event and signature provided. I don't want to hunt for the signature etc.. I thought we can select the...
13
by: Scott M. | last post by:
In a VS 2005 ASP .NET Web Application Project (WAP), how can I see a list of the page (web form) events (i.e. new, init, loadviewstate, load, saveviewstate, etc.) and set up event handlers for them?
2
by: kellygreer1 | last post by:
So by default the editor only throws in "protected void Page_Load" event. What is the correct way to add in other events. I had in the past copied the events from other pages where I had...
3
by: bsnl | last post by:
Hi, my company has a bunch of web pages on which they want to record every DOM event(mouse movement, clicks etc), these pages were written in past and now with minimal editing I need to add listener...
2
by: Kemmylinns12 | last post by:
Blockchain technology has emerged as a transformative force in the business world, offering unprecedented opportunities for innovation and efficiency. While initially associated with cryptocurrencies...
0
by: antdb | last post by:
Ⅰ. Advantage of AntDB: hyper-convergence + streaming processing engine In the overall architecture, a new "hyper-convergence" concept was proposed, which integrated multiple engines and...
0
by: AndyPSV | last post by:
HOW CAN I CREATE AN AI with an .executable file that would suck all files in the folder and on my computerHOW CAN I CREATE AN AI with an .executable file that would suck all files in the folder and...
0
by: Arjunsri | last post by:
I have a Redshift database that I need to use as an import data source. I have configured the DSN connection using the server, port, database, and credentials and received a successful connection...
0
hi
by: WisdomUfot | last post by:
It's an interesting question you've got about how Gmail hides the HTTP referrer when a link in an email is clicked. While I don't have the specific technical details, Gmail likely implements measures...
1
by: Matthew3360 | last post by:
Hi, I have been trying to connect to a local host using php curl. But I am finding it hard to do this. I am doing the curl get request from my web server and have made sure to enable curl. I get a...
0
Oralloy
by: Oralloy | last post by:
Hello Folks, I am trying to hook up a CPU which I designed using SystemC to I/O pins on an FPGA. My problem (spelled failure) is with the synthesis of my design into a bitstream, not the C++...
0
by: Carina712 | last post by:
Setting background colors for Excel documents can help to improve the visual appeal of the document and make it easier to read and understand. Background colors can be used to highlight important...
0
by: Ricardo de Mila | last post by:
Dear people, good afternoon... I have a form in msAccess with lots of controls and a specific routine must be triggered if the mouse_down event happens in any control. Than I need to discover what...

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.