Join the social network of Tech Nerds, increase skill rank, get work, manage projects...
 
Node is saved as draft in My Content >> Draft
  • Event Handling in .NET

    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 60
    Comment on it

    While writing code in ASP.NET we always write it inside events associated with the control.

     

    Event Arguments

    private void EventName (object sender, EventArgs e);

     

    Event Handling Using Controls

    <asp:Button ID="btnCancel" runat="server" Text="Cancel" />
    
    
    Protected Sub btnCancel_Click(ByVal sender As Object, ByVal e As System.EventArgs)
    
    End Sub

     

     

    <%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs" 
       Inherits="eventdemo._Default" %>
    
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
       "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    
    <html xmlns="http://www.w3.org/1999/xhtml" >
    
       <head runat="server">
          <title>Untitled Page</title>
       </head>
       
       <body>
          <form id="form1" runat="server">
             <div>
                <asp:Label ID="lblmessage" runat="server" >
                
                </asp:Label>
                
                <br />
                <br />
                <br />
                
                <asp:Button ID="btnclick" runat="server" Text="Click" onclick="btnclick_Click" />
             </div>
          </form>
       </body>
       
    </html>
    .net

 0 Comment(s)

Sign In
                           OR                           
                           OR                           
Register

Sign up using

                           OR                           
Forgot Password
Fill out the form below and instructions to reset your password will be emailed to you:
Reset Password
Fill out the form below and reset your password: