RE: C# Event Code
- From: stcheng@xxxxxxxxxxxxxxxxxxxx (Steven Cheng[MSFT])
- Date: Mon, 19 Feb 2007 06:55:03 GMT
Hello AG,
As for the C# development IDE, it does be a bit different from the VB.NET
IDE since they'are all customized according to the programming preference
of developers(or the language characteristics).
When you wang to register and event handler for an ASP.NET web control in
codebehind through Visual C# IDE, you can follow the following steps:
1. Switch to design view of the page, and select the certain control
2. Keep the control selected and go to the "properties window"
3. In the properties window, click the event tab(with a lighting icon),
then you'll see all the available events of the control
4. double click the certain event in the list to add a event handler in
codebehind(or you can select and existing handler functino from the
dropdownlist)
Here is the MSDN reference which detailedly describe this:
#How to: Create Event Handlers in ASP.NET Web Pages (Visual Studio)
http://msdn2.microsoft.com/en-gb/library/6w2tb12s(VS.80).aspx
BTW, for page events, the above rule doesn't apply. You need to directly
add the "Page_XXXX" handler function in codebehind (such as Page_Load,
Page_PreRender) and the runtime compiler will automatically wire it up.
Hope this helps.
Sincerely,
Steven Cheng
Microsoft MSDN Online Support Lead
==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx#notif
ications.
Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscriptions/support/default.aspx.
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.
.
- Follow-Ups:
- Re: C# Event Code
- From: Patrick
- Re: C# Event Code
- From: AG
- Re: C# Event Code
- References:
- C# Event Code
- From: AG
- C# Event Code
- Prev by Date: Re: Creating an element in vb.net at run-time
- Next by Date: Re: asp.net and excel.application in interop
- Previous by thread: C# Event Code
- Next by thread: Re: C# Event Code
- Index(es):
Relevant Pages
|