照葫芦画瓢,写了一个ASP.NET的程序,取名叫frist.aspx吧,权当我的第一个ASP.NET的程序吧。全部程序如下:
<Script Language="vb" Runat="Server"> Sub myButton_Click(sender As Object, e As EventArgs) myLabel.Text = "非常高兴,恭喜您" & myTextBox.Text & ",您的第一个ASP.NET的程序运行完全正常" End Sub</Script>
<Html> <Body>
<Form Runat = "Server"> 请输入您的姓名: <ASP:TextBox Runat = "server" Id="myTextBox"/> <ASP:Button Runat = "Server" Id="myButton" Text="确定" OnClick="myButton_Click"/> <br><br> <ASP:Label Runat = "Server" Id="myLabel"/> </Form> </Body></Html>
这个程序运行非常成功,哈哈,有点开心,但是想想,他的运行原理是什么?看看他的编译源:
行 1: ''''------------------------------------------------------------------------------行 2: '''' <autogenerated>行 3: '''' This code was generated by a tool.行 4: '''' Runtime Version: 1.1.4322.573行 5: ''''行 6: '''' Changes to this file may cause incorrect behavior and will be lost if 行 7: '''' the code is regenerated.行 8: '''' </autogenerated>行 9: ''''------------------------------------------------------------------------------行 10: 行 11: Option Strict Off行 12: Option Explicit On行 13: 行 14: Imports Microsoft.VisualBasic行 15: Imports System行 16: Imports System.Collections行 17: Imports System.Collections.Specialized行 18: Imports System.Configuration行 19: Imports System.Text行 20: Imports System.Text.RegularExpressions行 21: Imports System.Web行 22: Imports System.Web.Caching行 23: Imports System.Web.Security行 24: Imports System.Web.SessionState行 25: Imports System.Web.UI行 26: Imports System.Web.UI.HtmlControls行 27: Imports System.Web.UI.WebControls行 28: 行 29: Namespace ASP行 30: 行 31: Public Class frist_aspx行 32: Inherits System.Web.UI.Page行 33: Implements System.Web.SessionState.IRequiresSessionState行 34: 行 35: Private Shared __autoHandlers As Integer行 36: 行 37: 行 38: #ExternalSource("D:\works\study\学习ASP.NET\frist.aspx",12)行 39: Protected myTextBox As System.Web.UI.WebControls.TextBox行 40: 行 41: #End ExternalSource行 42: 行 43: 行 44: #ExternalSource("D:\works\study\学习ASP.NET\frist.aspx",13)行 45: Protected myButton As System.Web.UI.WebControls.Button行 46: 行 47: #End ExternalSource行 48: 行 49: 行 50: #ExternalSource("D:\works\study\学习ASP.NET\frist.aspx",15)行 51: Protected myLabel As System.Web.UI.WebControls.Label行 52: 行 53: #End ExternalSource行 54: 行 55: 行 56: #ExternalSource("D:\works\study\学习ASP.NET\frist.aspx",10)行 57: Private __control2 As System.Web.UI.HtmlControls.HtmlForm行 58: 行 59: #End ExternalSource行 60: 行 61: Private Shared __initialized As Boolean = false行 62: 行 63: Private Shared __fileDependencies As System.Collections.ArrayList行 64: 行 65: 行 66: #ExternalSource("D:\works\study\学习ASP.NET\frist.aspx",1)行 67: 行 68: Sub myButton_Click(sender As Object, e As EventArgs)行 69: myLabel.Text = "非常高兴,恭喜您" & myTextBox.Text & ",您的第一个ASP.NET的程序运行完全正常"行 70: End Sub行 71: 行 72: #End ExternalSource行 73: 行 74: Public Sub New()行 75: MyBase.New行 76: Dim dependencies As System.Collections.ArrayList行 77: If (ASP.frist_aspx.__initialized = false) Then行 78: dependencies = New System.Collections.ArrayList行 79: dependencies.Add("D:\works\study\学习ASP.NET\frist.aspx")行 80: ASP.frist_aspx.__fileDependencies = dependencies行 81: ASP.frist_aspx.__initialized = true行 82: End If行 83: End Sub行 84: 行 85: Protected Overrides Property AutoHandlers As Integer行 86: Get行 87: Return ASP.frist_aspx.__autoHandlers行 88: End Get行 89: Set行 90: ASP.frist_aspx.__autoHandlers = value行 91: End Set行 92: End Property行 93: 行 94: Protected ReadOnly Property ApplicationInstance As System.Web.HttpApplication行 95: Get行 96: Return CType(Me.Context.ApplicationInstance,System.Web.HttpApplication)行 97: End Get行 98:&nbs
[1] [2] [3] 下一页
Copyright @ 2007-2012 敏韬网(敏而好学,文韬武略--MinTao.Net)(学习笔记) Inc All Rights Reserved. 闵涛 E_mail:admin@mintao.net(欢迎提供学习资源)
鄂公网安备 42011102001154号
站长:MinTao ICP备案号:鄂ICP备11006601号-18