Inherits="sbgl.WebForm1"这是你的html页面第一句的部分语句,我想询问的是你的sbg1是不是名称空间的名称,如果是,那么在代码没有这个名称的限定啊!!
加上或者删除这个名称空间试一试!!
加上或者删除这个名称空间试一试!!
解决方案 »
- 关于询问对话框?如何写比较好,先谢谢了!
- 如何取得视图中的字段,select * from syscolumns where id = object_id('XT_JCDW')
- 请教动态成图 并显示的问题
- 几道测试题
- 高手们帮帮我吧,我晕了二天了,请教如何读取sqlserver中的图片到页面中image控件中显示
- ASP.NET中锁定一个页面
- 请教各位高手,怎么把aspx的后缀名改成其他的后缀名?
- 高分求解DataGrid中模板列的问题
- 请高手帮我解决ASP.net的图表问题,用OWC做的(附源码,可拷贝回VS.NET再修改)。_高难度技术给100分
- ASP.NET怎么能看到打开文件的路径(我是初学ASP.NET)
- 我想让我的DBGrid只绑定表中的某几列,不是全部的列。应该怎么做?
- 关于timer控件的问题
'在此处放置初始化页的用户代码
Label1.Text = "page load here"
End Sub
不好意思不知道是vb
在Page_Load事件必须加上
if (!Page.IsPostBack)
{
Label1.Text = "page load here";
}(c#),
这样就不会在事件执行时再进行一遍赋值了,你自己改成vb把,其他不用改
<%@ Page Language="vb" Codebehind="WebForm1.aspx.vb" AutoEventWireup="false" Inherits="sbgl.WebForm1" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD>
<title>WebForm1</title>
<meta content="Microsoft Visual Studio .NET 7.0" name="GENERATOR">
<meta content="Visual Basic 7.0" name="CODE_LANGUAGE">
<meta content="JavaScript" name="vs_defaultClientScript">
<meta content="http://schemas.microsoft.com/intellisense/ie5" name="vs_targetSchema">
</HEAD>
<body MS_POSITIONING="GridLayout">
<form id="Form1" runat="server">
<FONT face="宋体"></FONT><FONT face="宋体"></FONT><FONT face="宋体"></FONT><FONT face="宋体">
</FONT><FONT face="宋体"></FONT><FONT face="宋体"></FONT><FONT face="宋体"></FONT>
<br>
<asp:button id="ValidateBtn" style="Z-INDEX: 102; LEFT: 166px; POSITION: absolute; TOP: 168px" runat="server" Text="valid"></asp:button>
<asp:label id="lblOutput" style="Z-INDEX: 103; LEFT: 106px; POSITION: absolute; TOP: 56px" runat="server" Text="Fill in the required fields below" Width="237px" Font-Size="10" Font-Name="Verdana" ForeColor="red"></asp:label>
<asp:textbox id="TextBox1" style="Z-INDEX: 104; LEFT: 107px; POSITION: absolute; TOP: 90px" runat="server" Width="162px" Height="34px"></asp:textbox>
</form>
</body>
</HTML>Imports System
Imports System.ComponentModel.Design
Imports System.Data
Imports System.Drawing
Imports System.Web
Imports System.Web.SessionState
Imports System.Web.UI
Imports System.Web.UI.WebControls
Imports System.Web.UI.HtmlControls
Imports Microsoft.VisualBasic
Imports System.Reflection
Public Class WebForm1
Inherits System.Web.UI.Page
Protected WithEvents Form1 As System.Web.UI.HtmlControls.HtmlForm
Protected WithEvents Form3 As System.Web.UI.HtmlControls.HtmlForm
Protected WithEvents ValidateBtn As System.Web.UI.WebControls.Button
Protected WithEvents lblOutput As System.Web.UI.WebControls.Label
Protected WithEvents TextBox1 As System.Web.UI.WebControls.TextBox
Protected WithEvents Form5 As System.Web.UI.HtmlControls.HtmlForm#Region " Web 窗体设计器生成的代码 " '该调用是 Web 窗体设计器所必需的。
<System.Diagnostics.DebuggerStepThrough()>
Private Sub InitializeComponent() End Sub Private Sub Page_Init(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Init
'CODEGEN: 此方法调用是 Web 窗体设计器所必需的
'不要使用代码编辑器修改它。
InitializeComponent()
End Sub#End Region
Private Sub ValidateBtn_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ValidateBtn.Click
If Not IsPostBack Then
'If (Page.IsValid) Then
lblOutput.Text = "Page is Valid!"
TextBox1.Text = "valid"
Else
lblOutput.Text = "Some of the required fields are empty"
End If End Sub
End Class可是依然不能得到我想要的结果,我想要这样的结果,但是这是我手工写的。
<%@ Page Language="VB" %>
<script runat="server"> ' Insert page code here
' Sub Button1_Click(sender As Object, e As EventArgs)
message.text = "ok login"
End Sub Sub Page_Load(sender As Object, e As EventArgs)
message.text = "请您登录"
End Sub</script>
<html>
<head>
<meta http-equiv="content-type" content="text/html;charset=gb2312" />
</head>
<body>
<form runat="server">
<p>
<asp:Label id="Label1" runat="server" font-size="Large" borderstyle="Dotted">设备管理信息系统</asp:Label>
</p>
<p>
<asp:Label id="Label2" runat="server">用户名:</asp:Label>
<asp:TextBox id="TextBox1" runat="server"></asp:TextBox>
<asp:RequiredFieldValidator id="RequiredFieldValidator1" runat="server" ErrorMessage="用户名必须输入" ControlToValidate="TextBox1"></asp:RequiredFieldValidator>
</p>
<p>
<asp:Label id="Label3" runat="server">口令:</asp:Label>
<asp:TextBox id="TextBox2" runat="server"></asp:TextBox>
<asp:RequiredFieldValidator id="RequiredFieldValidator2" runat="server" ErrorMessage="口令必须输入" ControlToValidate="TextBox2"></asp:RequiredFieldValidator>
</p>
<p>
<asp:Button id="Button1" onclick="Button1_Click" runat="server" Text="登录"></asp:Button>
</p>
<p>
<asp:Label id="message" runat="server"></asp:Label>
</p>
<!-- Insert content here -->
</form>
</body>
</html>
if Not IsPostBack then
lblOutput.Text = "请您登录"
end if
End Sub Private Sub ValidateBtn_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ValidateBtn.Click
If TextBox1.Text.Trim() <> String.Empty Then
lblOutput.Text = "Page is Valid!"
TextBox1.Text = "valid"
Else
lblOutput.Text = "Some of the required fields are empty"
End If
End Sub
I use vs.net 2002 to design my program,but it not work as I expected.
finally i download vs.net 2003 and redesign my program ,aha ,it work.
thank you again.