Event in code behind file (VB.net) : Button « Asp Control « ASP.Net

ASP.Net
1. ADO.net Database
2. Asp Control
3. Collections
4. Components
5. Data Binding
6. Development
7. HTML Control
8. Mobile Control
9. Page
10. Request
11. Response
12. Server
13. Session Cookie
14. User Control and Master Page
15. Validation by Control
16. Validation by Function
17. XML
Microsoft Office Word 2007 Tutorial
Java
Java Tutorial
Java Source Code / Java Documentation
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
C# / C Sharp
C# / CSharp Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
PHP
Python
SQL Server / T-SQL
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
ASP.Net » Asp Control » Button 
Event in code behind file (VB.net)

<%@ Page 
    language=VB 
    debug=true 
    src="EventsInCodeBehind.vb" 
    Inherits="clsEventsInCodeBehind" 
%>
<HTML>
<HEAD>
<TITLE>Inheriting Events in a Code-Behind Files</TITLE>
</HEAD>
<form runat="server">
<BR><BR>
<asp:label
    id="lblMessage1"
    runat="Server"
/>
<BR><BR>
<asp:label
    id="lblMessage2"
    runat="Server"
/>
<BR><BR>
Enter text to uppercase:
<BR>
<asp:textbox
    id="txtUCase"
    runat="Server"
/>
<BR><BR>
Add Numbers:
<BR>
<asp:textbox
    id="txtNumber1"
    runat="Server"
/>
<BR>
<asp:textbox
    id="txtNumber2"
    runat="Server"
/>
<asp:button 
    id="butAdd"
    text="Add"
    runat="server"
/>
</form>
</BODY>
</HTML>

<%--
Public Class clsEventsInCodeBehind
    Inherits System.Web.UI.Page
    Protected WithEvents txtUCase As _
        System.Web.UI.WebControls.TextBox
    Protected WithEvents txtNumber1 As _
        System.Web.UI.WebControls.TextBox
    Protected WithEvents txtNumber2 As _
        System.Web.UI.WebControls.TextBox
    Protected WithEvents lblMessage1 As _
        System.Web.UI.WebControls.Label
    Protected WithEvents lblMessage2 As _
        System.Web.UI.WebControls.Label
    Protected WithEvents butAdd As _
        System.Web.UI.WebControls.Button
    Private Sub Page_Init(ByVal sender As System.Object, _
        ByVal e As System.EventArgs)
        lblMessage1.Text = Date.Now
        txtUcase.AutoPostBack = True
    End Sub
    Private Sub Page_Load(ByVal sender As System.Object, _
        ByVal e As System.EventArgs)
        lblMessage2.Text = Date.Now
    End Sub
    Sub txtUCase_Change(Sender As System.Object, _
        As System.EventArgsHandles txtUCase.TextChanged
        Dim TempString as String
        TempString = txtUCase.Text
        txtUCase.Text = TempString.ToUpper()
    End Sub
    Sub butAdd_Click(Sender As System.Object, _
        As System.EventArgsHandles butAdd.Click
        butAdd.Text = CSng(txtNumber1.Text+ CSng(txtNumber2.Text)
    End Sub
End Class
--%>
           
       
Related examples in the same category
1. asp:button: command name and arguments (VB.net)
2. Event driven page (VB.net)
3. Set Button text (VB.net)
4. asp:button event to change the label text (VB.net)
5. Button action Command and Parameter (VB.net)
6. Add action listener to a server Button (VB.net)
7. asp button postbackurl (C#)
8. asp button on client click (C#)
9. Button counter: click and change button label (C#)
10. Add action listener to asp Button by delegate (C#)
11. Read input and do the calculation in Button action listener (C#)
12. Button event Handler (C#)
w___w_w._jav_a__2___s_.__c___o__m_ | Contact Us
Copyright 2003 - 08 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.