//HelloWorld.aspx
<%@ Page language="c#" Codebehind="HelloWorld.aspx.cs" Inherits="sample.WebForm1" %>
<HTML>
<body>
<form id="Form1" method="post" runat="server">
<center>
<asp:Label id="my" runat="server" Font-Size="30">Hello World</asp:Label>
</center>
</form>
</body>
</HTML>//HelloWorld.aspx.cs
using System;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.HtmlControls;namespace sample
{
public class WebForm1 : System.Web.UI.Page
{
protected System.Web.UI.WebControls.Label Label1;
public WebForm1()
{
Page.Init += new System.EventHandler(Page_Init);
} private void Page_Load(object sender, System.EventArgs e)
{
// 加入页面加载时需要处理的代码
} private void Page_Init(object sender, EventArgs e)
{
InitializeComponent();
}
private void InitializeComponent()
{
this.Load += new System.EventHandler(this.Page_Load);
}
}
}
怎么会提示
Parser Error Message: Could not load type 'sample.WebForm1'.
是不是我的设置有问题啊
<%@ Page language="c#" Codebehind="HelloWorld.aspx.cs" Inherits="sample.WebForm1" %>
<HTML>
<body>
<form id="Form1" method="post" runat="server">
<center>
<asp:Label id="my" runat="server" Font-Size="30">Hello World</asp:Label>
</center>
</form>
</body>
</HTML>//HelloWorld.aspx.cs
using System;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.HtmlControls;namespace sample
{
public class WebForm1 : System.Web.UI.Page
{
protected System.Web.UI.WebControls.Label Label1;
public WebForm1()
{
Page.Init += new System.EventHandler(Page_Init);
} private void Page_Load(object sender, System.EventArgs e)
{
// 加入页面加载时需要处理的代码
} private void Page_Init(object sender, EventArgs e)
{
InitializeComponent();
}
private void InitializeComponent()
{
this.Load += new System.EventHandler(this.Page_Load);
}
}
}
怎么会提示
Parser Error Message: Could not load type 'sample.WebForm1'.
是不是我的设置有问题啊
解决方案 »
- 将此 <customErrors> 标记的“mode”属性设置为“Off”
- 提示窗口的问题。。。。
- asp.net如何做好友管理
- 实现鼠标移到GridView某一行时改变该行的背景色功能出现的一个问题?
- ajax问题:同一个程序在本地机和服务器上结果不同(急!!!)
- 做asp学asp.net的同志们,进来分享一下经验!怎么学好.net!
- 面试的三个问题
- Newtonsoft.Json的序列化怎么实现???
- 用.net(C# / VB)怎样关闭一个页面? 难道只能用javascript吗??怎样把关闭页面被关闭的信息写入Session??
- <authentication mode="Windows" />应用程序中的服务器错误?
- 有关无刷新的问题
- 各位朋友请进来帮帮小弟,用什么控件可以编辑选定的文字,以及显示编辑后的文字???急用,在线等待,谢谢各位兄弟姐妹啦!!!
<%@ Page language="c#" Codebehind="HelloWorld.aspx.cs" Inherits="sample.WebForm1" %>
Ctrl + Shift + B編譯一次.
你先在IIS中创建应用程序试之.当然,你也必须在Vs.net生成应用程序哦.
文件都放在那里
如果有c#的代码放在.aspx文件里是可以运行的
但是放在.cs 文件下就出现这种错误
=============>
Codebehind="WebForm1.aspx.cs"
在"运行/生成解决方案"..运行一次就OK了~~~
然后将.dll拷贝到你的应用程序的根目录下的BIN/目录下.
然后就可以在.aspx文件中引用.dll了.
<%@ Page language="c#" Inherits="sample.WebForm1" %>