RE: C# Event Code

Tech-Archive recommends: Fix windows errors by optimizing your registry



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.




.



Relevant Pages

  • Re: Option Strict Off/On
    ... templates i.e. when you create a file it actually copies a template. ... On setting is set on an Visual Studio IDE instance. ... Microsoft Online Community Support ... where an initial response from the community or a Microsoft Support ...
    (microsoft.public.dotnet.languages.vb)
  • Re: invisible gui
    ... it's Load event is fired first. ... until all lines of code in its Load event handler finish executing. ... Microsoft Online Community Support ... where an initial response from the community or a Microsoft Support ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: AutoEventWireup and PreInit
    ... automatically register the event handler for you. ... And the "PreInit" is ... Microsoft MSDN Online Support Lead ... where an initial response from the community or a Microsoft Support ...
    (microsoft.public.dotnet.framework.aspnet)
  • RE: Test View window crashing Visual Studio 2008
    ... My problem seems occur as i add more test projects ... Each time that the IDE crashes i have been sending the Error Report to ... The MSDN Managed Newsgroup support offering is for non-urgent issues ... where an initial response from the community or a Microsoft Support ...
    (microsoft.public.vsnet.ide)
  • Re: C# Event Code
    ... When you wang to register and event handler for an ASP.NET web control in ... Switch to design view of the page, and select the certain control ... Microsoft MSDN Online Support Lead ... where an initial response from the community or a Microsoft Support ...
    (microsoft.public.dotnet.framework.aspnet)