首先配制好自己的环境,要能够运行aspx程序。。
把下面这段保存成 hello.aspx
<%@ Page Language="vb" Src="hellocodebehindvb.vb" Inherits="HelloWebFormVb"%>
<HTML>
<HEAD>
<title>我的第一个Asp.Net程序</title>
</HEAD>
<body>
使用VB.Net写的第一个小程序,庆祝一下。<P><P>
<form runat="server" ID="Form1">
<asp:button runat="server" text="点击" ID="Button1" />
<p>
<asp:label runat="server" text="" id="TheLabel" />
</form>
</body>
</HTML>
把下面这段保存成文件hellocodebehindvb.vb
Public Class HelloWebFormVb
Inherits System.Web.UI.Page
Protected WithEvents Button1 As System.Web.UI.WebControls.Button
Protected TheLabel As System.Web.UI.WebControls.Label
Private Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1.Click
TheLabel.Text = "您好,我是慈勤强,看到了吗?^o^<p>"+Button1.Text+"<p>"+TheLabel.Text
End Sub
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
'在此处放置初始化页的用户代码
TheLabel.Text = "<a href=Http://blog.csdn.net/cqq>Http://blog.csdn.net/cqq</a>"
End Sub
End Class
然后运行 hello.aspx 就可以了
本文地址:http://com.8s8s.com/it/it7349.htm