By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
455,467 Members | 1,619 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 455,467 IT Pros & Developers. It's quick & easy.

VS.Net Dropdowns for objects and Events

P: n/a
Again, I'm a VB.Net Developer learining C# and I have another question...

(BTW, my questions on this forum, thus far, have been "newbie" questions but
no one seems to be able to answer any of them)

With VB.net when the codebehind file is being edited there are two dropdowns
at the top. the Left one has a list of all of the objects on the Page. The
right one has all of the events that exist for the object selected in the
left dropdown. That's what I use to write code to respond to events.

But in C#, the only thing is the left dropdown is ProjectName.PageName. the
right dropdown has the objects on the page. There is no dropdown that has
the events listed.

What goes? Is this the way it is supposed to behave?

Thanks,
T
May 12 '06 #1
Share this Question
Share on Google+
5 Replies


P: n/a

"Tina" <ti**********@nospammeexcite.com> wrote in message
news:%2******************@TK2MSFTNGP02.phx.gbl...
Again, I'm a VB.Net Developer learining C# and I have another question...

(BTW, my questions on this forum, thus far, have been "newbie" questions
but no one seems to be able to answer any of them)

With VB.net when the codebehind file is being edited there are two
dropdowns at the top. the Left one has a list of all of the objects on
the Page. The right one has all of the events that exist for the object
selected in the left dropdown. That's what I use to write code to respond
to events.

But in C#, the only thing is the left dropdown is ProjectName.PageName.
the right dropdown has the objects on the page. There is no dropdown that
has the events listed.

What goes? Is this the way it is supposed to behave?

Thanks,
T


Yes, this is how it is supposed to behave. If you want to see a list of
events, via the designer, open the form in design view and then open the
property window for the object you want to add the event handler for. Then,
click on the little lightning bolt on the property window (should be at the
top of the property window). This switches to an the listing of available
events to attach to :) Double-click on one of the events to add the
objectName.<eventHere> += new blah(...) code as well as the templated event
handler for that event :)

HTH,
Mythran

May 12 '06 #2

P: n/a
Well, correct you are. (So much for no one on this forum being able to
answer simple questions.)

Seems like this is a difference between c# and vb that there didn't need
exist. wonder why it's that way.

Thanks for your help.
T
"Mythran" <ki********@hotmail.comREMOVETRAIL> wrote in message
news:u1****************@TK2MSFTNGP05.phx.gbl...

"Tina" <ti**********@nospammeexcite.com> wrote in message
news:%2******************@TK2MSFTNGP02.phx.gbl...
Again, I'm a VB.Net Developer learining C# and I have another question...

(BTW, my questions on this forum, thus far, have been "newbie" questions
but no one seems to be able to answer any of them)

With VB.net when the codebehind file is being edited there are two
dropdowns at the top. the Left one has a list of all of the objects on
the Page. The right one has all of the events that exist for the object
selected in the left dropdown. That's what I use to write code to
respond to events.

But in C#, the only thing is the left dropdown is ProjectName.PageName.
the right dropdown has the objects on the page. There is no dropdown
that has the events listed.

What goes? Is this the way it is supposed to behave?

Thanks,
T


Yes, this is how it is supposed to behave. If you want to see a list of
events, via the designer, open the form in design view and then open the
property window for the object you want to add the event handler for.
Then, click on the little lightning bolt on the property window (should be
at the top of the property window). This switches to an the listing of
available events to attach to :) Double-click on one of the events to add
the objectName.<eventHere> += new blah(...) code as well as the templated
event handler for that event :)

HTH,
Mythran

May 12 '06 #3

P: n/a

"Tina" <ti**********@nospammeexcite.com> wrote in message
news:eG**************@TK2MSFTNGP04.phx.gbl...
Well, correct you are. (So much for no one on this forum being able to
answer simple questions.)

Seems like this is a difference between c# and vb that there didn't need
exist. wonder why it's that way.

Thanks for your help.
T


Well, the difference isn't in C# and VB.Net, it's in the MS.Net IDE :)

Mythran

May 12 '06 #4

P: n/a
So, how do I call out the Page_PreRender event - for instance?
T

"Mythran" <ki********@hotmail.comREMOVETRAIL> wrote in message
news:u1****************@TK2MSFTNGP05.phx.gbl...

"Tina" <ti**********@nospammeexcite.com> wrote in message
news:%2******************@TK2MSFTNGP02.phx.gbl...
Again, I'm a VB.Net Developer learining C# and I have another question...

(BTW, my questions on this forum, thus far, have been "newbie" questions
but no one seems to be able to answer any of them)

With VB.net when the codebehind file is being edited there are two
dropdowns at the top. the Left one has a list of all of the objects on
the Page. The right one has all of the events that exist for the object
selected in the left dropdown. That's what I use to write code to
respond to events.

But in C#, the only thing is the left dropdown is ProjectName.PageName.
the right dropdown has the objects on the page. There is no dropdown
that has the events listed.

What goes? Is this the way it is supposed to behave?

Thanks,
T


Yes, this is how it is supposed to behave. If you want to see a list of
events, via the designer, open the form in design view and then open the
property window for the object you want to add the event handler for.
Then, click on the little lightning bolt on the property window (should be
at the top of the property window). This switches to an the listing of
available events to attach to :) Double-click on one of the events to add
the objectName.<eventHere> += new blah(...) code as well as the templated
event handler for that event :)

HTH,
Mythran

May 15 '06 #5

P: n/a

"Tina" <ti**********@nospammeexcite.com> wrote in message
news:OF**************@TK2MSFTNGP04.phx.gbl...
So, how do I call out the Page_PreRender event - for instance?
T


What I would do, is instead of using an event handler for any page events, I
would override the method that raises the event. So, instead of
Page_PreRender, I would override the OnPreRender method, and call the base
prerender method prior to the rest of my code.

So,

protected override void OnPreRender(EventArgs e)
{
base.OnPreRender(e);
... yer code here ...
}

HTH,
Mythran

May 15 '06 #6

This discussion thread is closed

Replies have been disabled for this discussion.