469,626 Members | 1,062 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,626 developers. It's quick & easy.

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 1520
"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 discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

2 posts views Thread by Paolo Mancini | last post: by
2 posts views Thread by John Lau | last post: by
8 posts views Thread by MaryA | last post: by
3 posts views Thread by =?Utf-8?B?VDhS?= | last post: by
1 post views Thread by Jordan S. | last post: by
1 post views Thread by Scott M. | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.