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

Adding EventHandlers to a webform

Just curious,

What is the proper way to add event handlers for web controls in a
ascx/aspx page in csharp?

The way I've been doing it up until this point is adding the +=
eventhandler in the Page_Init method.

Is there a more effecient way/proper way to do this?

thanks
Nov 15 '05 #1
2 1477
DKode,

Nope, that's pretty much it. An event in an ASP.NET page is the same as
an event anywhere else in C#, and the way you attach to events is using the
+= syntax when you want to hook up to the event.

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"DKode" <dk***@cfl.rr.com> wrote in message
news:b1************************@posting.google.com ...
Just curious,

What is the proper way to add event handlers for web controls in a
ascx/aspx page in csharp?

The way I've been doing it up until this point is adding the +=
eventhandler in the Page_Init method.

Is there a more effecient way/proper way to do this?

thanks

Nov 15 '05 #2
Thank you nicholas,

that answers my question.

csharp seems to be a much more effecient syntax wise than vb.net and
coming from perl/php, the syntax is closer than vb.

I appreciate your help. Thank you!

"Nicholas Paldino [.NET/C# MVP]" <mv*@spam.guard.caspershouse.com> wrote in message news:<ua**************@TK2MSFTNGP10.phx.gbl>...
DKode,

Nope, that's pretty much it. An event in an ASP.NET page is the same as
an event anywhere else in C#, and the way you attach to events is using the
+= syntax when you want to hook up to the event.

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"DKode" <dk***@cfl.rr.com> wrote in message
news:b1************************@posting.google.com ...
Just curious,

What is the proper way to add event handlers for web controls in a
ascx/aspx page in csharp?

The way I've been doing it up until this point is adding the +=
eventhandler in the Page_Init method.

Is there a more effecient way/proper way to do this?

thanks

Nov 15 '05 #3

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

Similar topics

3
by: Kiyomi | last post by:
Hello, I create a Table1 dynamically at run time, and at the same time, I would like to create LinkButton controls, also dynamically, and insert them into each line in my Table1. I would...
3
by: Rene | last post by:
Hi, I'm expierenced with C++ and VB6 and learning C#. I tried some small application in VB.NET too. But I'm stuck with the IDE: Say in put a button on a form and I double click the button. C#...
3
by: Robert | last post by:
I need some assistance doing some "right way to do it" coding. The following are EventHandlers associated with Delegates in a child form that call a procedure in the MDI form that resets a timer....
3
by: mg | last post by:
Any articles and/or examples on adding header/footer to WebForm (C#) ?
6
by: cpnet | last post by:
I've authored a custom web component (a non-ui component kinda like a DataSet) and so far it's working. When my web component is added to the web form in the designer from the toolbox, the...
1
by: Timo | last post by:
I haven't tried coding eventhandlers in Global.asax yet -- any "gotchas" I should be aware of? Do programming errors there require bouncing IIS? Will handlers in Global.asax be able to access...
3
by: Armin | last post by:
Hello I have a UserControl with a Click Event. Is it possible to find out the List of all Delegates/Eventhandlers using the Event. I read something about a "getinvocationlist" Methode for...
8
by: Nathan Sokalski | last post by:
I want to dynamically add a stylesheet using <style type="text/css"></style> tags. The code that will use this stylesheet will be shared, so I will not have control over what the user does as far...
1
by: Christian Cambier | last post by:
Hi, in VS.NET 2008, how do I know what form-eventhandler exist? how can I add a form-eventhandler in the code-behind file apart from manually? cause when I select the properties of the...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
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...

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.