473,387 Members | 1,542 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,387 software developers and data experts.

Page Events

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?
Jan 16 '08 #1
13 1651
"Scott M." <sm**@nospam.nospamwrote in message
news:uh**************@TK2MSFTNGP06.phx.gbl...
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?
In the code behind file, select "(FormName) Events" in the dropdown in the
top right, and all the form's events will be listed in the dropdown to the
right.

Jan 16 '08 #2
"Scott M." <sm**@nospam.nospamwrote in message
news:uh**************@TK2MSFTNGP06.phx.gbl...
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?
Not quite sure what you mean about "seeing" the events...?

As for setting up event handlers for them, just start typing...

E.g. if you want a Page_Init event, just type the following into your
code-behind:

protected void Page_Init(object sender, System.EventArgs e)
{

}

and add some code...
--
Mark Rae
ASP.NET MVP
http://www.markrae.net

Jan 16 '08 #3
"Leon Mayne" <leon@rmv_me.mvps.orgwrote in message
news:C5**********************************@microsof t.com...
"Scott M." <sm**@nospam.nospamwrote in message
news:uh**************@TK2MSFTNGP06.phx.gbl...
>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?

In the code behind file, select "(FormName) Events" in the dropdown in the
top right, and all the form's events will be listed in the dropdown to the
right.
Looking at your other post, I see that you're using C#, not VB.NET. In that
case the above method won't work. Not sure in C#. You could look at the
object's events in the class viewer?

Jan 16 '08 #4
"Mark Rae [MVP]" <ma**@markNOSPAMrae.netwrote in message
news:eo**************@TK2MSFTNGP05.phx.gbl...
"Scott M." <sm**@nospam.nospamwrote in message
news:uh**************@TK2MSFTNGP06.phx.gbl...
>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?

Not quite sure what you mean about "seeing" the events...?

As for setting up event handlers for them, just start typing...

E.g. if you want a Page_Init event, just type the following into your
code-behind:

protected void Page_Init(object sender, System.EventArgs e)
{

}

and add some code...
I think the OP would like to see a list of events availble for an object,
e.g. if you didn't know that the Page_Init event existed then you'd have
trouble using it! In VB you can get a list of the object's events and when
you select one it will automatically create the handler for you. I can't see
similar functionality in C#. Do you know how to do this, as I'm also
interested!

Jan 16 '08 #5
With your page open in the IDE, select "Page" from the leftmost dropdown
above the code...and then select the available events from the dropdown to its right.

Juan T. Llibre, asp.net MVP
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en español : http://asp.net.do/foros/
======================================
"Scott M." <sm**@nospam.nospamwrote in message news:uh**************@TK2MSFTNGP06.phx.gbl...
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?

Jan 16 '08 #6
>
Looking at your other post, I see that you're using C#, not VB.NET. In
that case the above method won't work. Not sure in C#. You could look at
the object's events in the class viewer?
Just a question about this difference ... is there any reason there isn't an
"event explorer" in c# as we've got in vb.net ??

Thanks in advance.
--
Gianluca Gravina
http://blogs.ugidotnet.org/thinkingingrava

Jan 16 '08 #7
>
I think the OP would like to see a list of events availble for an object,
e.g. if you didn't know that the Page_Init event existed then you'd have
trouble using it! In VB you can get a list of the object's events and when
you select one it will automatically create the handler for you. I can't
see similar functionality in C#. Do you know how to do this, as I'm also
interested!
Well, by default starting writing "this." and let the intellisense show up,
then you can search for events (you've got an icon that it's quite
self-explanatory). By default if you've got an event like "PreInit", with
autoEventWireUp you can write the code Page_PreInit, if the attribute is set
to false you have to override the method that will raise the event:

override OnPreInit()
{
base.OnPreInit();
// my code
}
--
Gianluca Gravina
http://blogs.ugidotnet.org/thinkingingrava

Jan 16 '08 #8
Yes, that's exactly the problem and what I'm after Leon!


"Leon Mayne" <leon@rmv_me.mvps.orgwrote in message
news:98**********************************@microsof t.com...
"Mark Rae [MVP]" <ma**@markNOSPAMrae.netwrote in message
news:eo**************@TK2MSFTNGP05.phx.gbl...
>"Scott M." <sm**@nospam.nospamwrote in message
news:uh**************@TK2MSFTNGP06.phx.gbl...
>>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?

Not quite sure what you mean about "seeing" the events...?

As for setting up event handlers for them, just start typing...

E.g. if you want a Page_Init event, just type the following into your
code-behind:

protected void Page_Init(object sender, System.EventArgs e)
{

}

and add some code...

I think the OP would like to see a list of events availble for an object,
e.g. if you didn't know that the Page_Init event existed then you'd have
trouble using it! In VB you can get a list of the object's events and when
you select one it will automatically create the handler for you. I can't
see similar functionality in C#. Do you know how to do this, as I'm also
interested!

Jan 16 '08 #9
If I type "this" in a page class, nothing happens. The only way I could do
that would be to go into an existing code block and type "this" to see the
intellisense dropdown. Then, I'd have to just know what is an event or an
overrideable event handler (which I can do). But, I was hoping for
something easier as in VB .NET, where you just select the top-left drop-down
in the code editor and then the top-right dropdown gives you the events for
the item in the left drop-down.

:(
"grava" <g_*******@hotmail.comwrote in message
news:96**********************************@microsof t.com...

I think the OP would like to see a list of events availble for an object,
e.g. if you didn't know that the Page_Init event existed then you'd have
trouble using it! In VB you can get a list of the object's events and
when you select one it will automatically create the handler for you. I
can't see similar functionality in C#. Do you know how to do this, as I'm
also interested!

Well, by default starting writing "this." and let the intellisense show
up, then you can search for events (you've got an icon that it's quite
self-explanatory). By default if you've got an event like "PreInit", with
autoEventWireUp you can write the code Page_PreInit, if the attribute is
set to false you have to override the method that will raise the event:

override OnPreInit()
{
base.OnPreInit();
// my code
}
--
Gianluca Gravina
http://blogs.ugidotnet.org/thinkingingrava

Jan 16 '08 #10
Hi Scott,

Yes, for the C# asp.net designer, the page level events list does be an
existing limitation(as VB.NET IDE are developed separately from C# one). I
really suggest you to submit your comments on this to our product feedback
site:

http://connect.microsoft.com/feedbac...spx?SiteID=210

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead
This posting is provided "AS IS" with no warranties, and confers no rights.

--------------------
>From: "Scott M." <sm**@nospam.nospam>
References: <uh**************@TK2MSFTNGP06.phx.gbl>
<eo**************@TK2MSFTNGP05.phx.gbl>
<98**********************************@microsoft.co m>
<96**********************************@microsoft.co m>
>Subject: Re: Page Events
Date: Wed, 16 Jan 2008 13:39:35 -0500

If I type "this" in a page class, nothing happens. The only way I could
do
>that would be to go into an existing code block and type "this" to see the
intellisense dropdown. Then, I'd have to just know what is an event or an
overrideable event handler (which I can do). But, I was hoping for
something easier as in VB .NET, where you just select the top-left
drop-down
>in the code editor and then the top-right dropdown gives you the events
for
>the item in the left drop-down.

:(
"grava" <g_*******@hotmail.comwrote in message
news:96**********************************@microso ft.com...
>
I think the OP would like to see a list of events availble for an
object,
>>e.g. if you didn't know that the Page_Init event existed then you'd
have
>>trouble using it! In VB you can get a list of the object's events and
when you select one it will automatically create the handler for you. I
can't see similar functionality in C#. Do you know how to do this, as
I'm
>>also interested!

Well, by default starting writing "this." and let the intellisense show
up, then you can search for events (you've got an icon that it's quite
self-explanatory). By default if you've got an event like "PreInit",
with
>autoEventWireUp you can write the code Page_PreInit, if the attribute is
set to false you have to override the method that will raise the event:

override OnPreInit()
{
base.OnPreInit();
// my code
}
--
Gianluca Gravina
http://blogs.ugidotnet.org/thinkingingrava


Jan 17 '08 #11
Thanks Steven, I'll do that.
"Steven Cheng[MSFT]" <st*****@online.microsoft.comwrote in message
news:MC**************@TK2MSFTNGHUB02.phx.gbl...
Hi Scott,

Yes, for the C# asp.net designer, the page level events list does be an
existing limitation(as VB.NET IDE are developed separately from C# one). I
really suggest you to submit your comments on this to our product feedback
site:

http://connect.microsoft.com/feedbac...spx?SiteID=210

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead
This posting is provided "AS IS" with no warranties, and confers no
rights.

--------------------
>>From: "Scott M." <sm**@nospam.nospam>
References: <uh**************@TK2MSFTNGP06.phx.gbl>
<eo**************@TK2MSFTNGP05.phx.gbl>
<98**********************************@microsoft.co m>
<96**********************************@microsoft.co m>
>>Subject: Re: Page Events
Date: Wed, 16 Jan 2008 13:39:35 -0500

If I type "this" in a page class, nothing happens. The only way I could
do
>>that would be to go into an existing code block and type "this" to see the
intellisense dropdown. Then, I'd have to just know what is an event or an
overrideable event handler (which I can do). But, I was hoping for
something easier as in VB .NET, where you just select the top-left
drop-down
>>in the code editor and then the top-right dropdown gives you the events
for
>>the item in the left drop-down.

:(
"grava" <g_*******@hotmail.comwrote in message
news:96**********************************@micros oft.com...
>>
I think the OP would like to see a list of events availble for an
object,
>>>e.g. if you didn't know that the Page_Init event existed then you'd
have
>>>trouble using it! In VB you can get a list of the object's events and
when you select one it will automatically create the handler for you. I
can't see similar functionality in C#. Do you know how to do this, as
I'm
>>>also interested!

Well, by default starting writing "this." and let the intellisense show
up, then you can search for events (you've got an icon that it's quite
self-explanatory). By default if you've got an event like "PreInit",
with
>>autoEventWireUp you can write the code Page_PreInit, if the attribute is
set to false you have to override the method that will raise the event:

override OnPreInit()
{
base.OnPreInit();
// my code
}
--
Gianluca Gravina
http://blogs.ugidotnet.org/thinkingingrava



Jan 17 '08 #12
"Juan T. Llibre" <no***********@nowhere.comwrote in message
news:eD**************@TK2MSFTNGP05.phx.gbl...
With your page open in the IDE, select "Page" from the leftmost dropdown
above the code...and then select the available events from the dropdown to
its right.
Sadly doesn't work in a C# ASP.NET project :-(

Scott: When you do add the enhancement request on connect, please post the
feedback Id on this thread so we can vote for it.

Jan 17 '08 #13
The Feedback ID is: 322994.

I've also posted this as a new thread in both the C# and the ASP .NET NG's
to hopefully attract more attention.

-Scott


"Leon Mayne" <leon@rmv_me.mvps.orgwrote in message
news:E4**********************************@microsof t.com...
"Juan T. Llibre" <no***********@nowhere.comwrote in message
news:eD**************@TK2MSFTNGP05.phx.gbl...
>With your page open in the IDE, select "Page" from the leftmost dropdown
above the code...and then select the available events from the dropdown
to its right.

Sadly doesn't work in a C# ASP.NET project :-(

Scott: When you do add the enhancement request on connect, please post the
feedback Id on this thread so we can vote for it.

Jan 18 '08 #14

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

Similar topics

8
by: Dan | last post by:
When a user clicks on a link in my menu, I want the background color of the link that comes up in the hover to remain on the destination page. My menu looks like this: <div id="adminmenu"> <a...
2
by: Paolo Mancini | last post by:
Hi all, I have a page with many different elements: <a href="...."> ... </a>, listboxes, radiobuttons, etc. Can I use javascript to prevent the user from interacting with the page? That is:...
2
by: John Lau | last post by:
Hi, Is there documentation that talks about the page lifecycle, the lifecycle of controls on the page, and the rendering of inline code, in a single document? Thanks, John
8
by: MaryA | last post by:
I have an aspx page that loads twice inspite of using the IsPostBack i removed all controls from the page and still the page_load event is called twice I appriciate any help coz i have lost...
9
by: Gummy | last post by:
Hello, I created a user control that has a ListBox and a RadioButtonList (and other stuff). The idea is that I put the user control on the ASPX page multiple times and each user control will...
10
by: Benton | last post by:
Hi there, I have a UserControl with a couple of textboxes and a couple of buttons ("Save" and "Cancel"). The Click event for this buttons is in the UserControl's codebehind of course, so here's...
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: Jordan S. | last post by:
I'm just wondering if this would work. Please note that I'm not asking *how* to raise events. I'm clear on that. What I'm not clear on is the sequence in which events are raised by custom controls...
1
by: Scott M. | last post by:
How can I get Visual Studio 2008 Pro. to show me a list of the Page class's events (as I can get in VB .NET)? In the page designer, with the DOCUMENT selected in the Properties Window, there is...
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: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
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
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

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.