打印本文 打印本文 关闭窗口 关闭窗口
今天写了第一个ASP.NET程序
作者:武汉SEO闵涛  文章来源:敏韬网  点击数2463  更新时间:2009/4/23 10:47:10  文章录入:mintao  责任编辑:mintao

照葫芦画瓢,写了一个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]  下一页

打印本文 打印本文 关闭窗口 关闭窗口