本文发表在 rolia.net 枫下论坛是这样子:我想试一下WEB FORM component,像button和datagrid等,顺手画了两个,运行后没有显示,而HTML的component却可以显示出来,不知道哪里出了问题。多谢!
cs文件如下:
public class WebForm1 : System.Web.UI.Page
{
protected System.Web.UI.WebControls.TextBox TextBox1;
protected System.Web.UI.WebControls.Button Button1;
private void Page_Load(object sender, System.EventArgs e)
{
// Put user code to initialize the page here
}
#region Web Form Designer generated code
override protected void OnInit(EventArgs e)
{
//
// CODEGEN: This call is required by the ASP.NET Web Form Designer.
//
InitializeComponent();
base.OnInit(e);
}
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.Load += new System.EventHandler(this.Page_Load);
}
#endregion
}
HTML文件如下:
<%@ Page language="c#" Codebehind="WebForm1.aspx.cs" AutoEventWireup="false" Inherits="Pick.WebForm1" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
<HTML>
<HEAD>
<title>WebForm1</title>
<meta name="GENERATOR" Content="Microsoft Visual Studio 7.0">
<meta name="CODE_LANGUAGE" Content="C#">
<meta name="vs_defaultClientScript" content="JavaScript">
<meta name="vs_targetSchema" content="http://schemas.microsoft.com/intellisense/ie5">
</HEAD>
<body MS_POSITIONING="GridLayout">
<form id="Form1" method="post" runat="server">
<DIV style="DISPLAY: inline; Z-INDEX: 101; LEFT: 24px; WIDTH: 70px; POSITION: absolute; TOP: 39px; HEIGHT: 15px" ms_positioning="FlowLayout">Label</DIV>
<INPUT style="Z-INDEX: 102; LEFT: 103px; POSITION: absolute; TOP: 38px" type="text">
<asp:TextBox id="TextBox1" style="Z-INDEX: 103; LEFT: 16px; POSITION: absolute; TOP: 97px" runat="server" Width="105px" Height="27px"></asp:TextBox>
<asp:Button id="Button1" style="Z-INDEX: 104; LEFT: 128px; POSITION: absolute; TOP: 95px" runat="server" Width="125px" Height="32px" Text="Button"></asp:Button>
</form>
</body>
</HTML>更多精彩文章及讨论,请光临枫下论坛 rolia.net
cs文件如下:
public class WebForm1 : System.Web.UI.Page
{
protected System.Web.UI.WebControls.TextBox TextBox1;
protected System.Web.UI.WebControls.Button Button1;
private void Page_Load(object sender, System.EventArgs e)
{
// Put user code to initialize the page here
}
#region Web Form Designer generated code
override protected void OnInit(EventArgs e)
{
//
// CODEGEN: This call is required by the ASP.NET Web Form Designer.
//
InitializeComponent();
base.OnInit(e);
}
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.Load += new System.EventHandler(this.Page_Load);
}
#endregion
}
HTML文件如下:
<%@ Page language="c#" Codebehind="WebForm1.aspx.cs" AutoEventWireup="false" Inherits="Pick.WebForm1" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
<HTML>
<HEAD>
<title>WebForm1</title>
<meta name="GENERATOR" Content="Microsoft Visual Studio 7.0">
<meta name="CODE_LANGUAGE" Content="C#">
<meta name="vs_defaultClientScript" content="JavaScript">
<meta name="vs_targetSchema" content="http://schemas.microsoft.com/intellisense/ie5">
</HEAD>
<body MS_POSITIONING="GridLayout">
<form id="Form1" method="post" runat="server">
<DIV style="DISPLAY: inline; Z-INDEX: 101; LEFT: 24px; WIDTH: 70px; POSITION: absolute; TOP: 39px; HEIGHT: 15px" ms_positioning="FlowLayout">Label</DIV>
<INPUT style="Z-INDEX: 102; LEFT: 103px; POSITION: absolute; TOP: 38px" type="text">
<asp:TextBox id="TextBox1" style="Z-INDEX: 103; LEFT: 16px; POSITION: absolute; TOP: 97px" runat="server" Width="105px" Height="27px"></asp:TextBox>
<asp:Button id="Button1" style="Z-INDEX: 104; LEFT: 128px; POSITION: absolute; TOP: 95px" runat="server" Width="125px" Height="32px" Text="Button"></asp:Button>
</form>
</body>
</HTML>更多精彩文章及讨论,请光临枫下论坛 rolia.net