日期:2014-05-17 浏览次数:20468 次
<%@ Page Language="C#" AutoEventWireup="true"%> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head runat="server"> <title></title> </head> <body> <form id="form1" runat="server"> <div> <%Response.Write("hellow word"); %><br /> </div> </form> </body> </html>
------解决方案--------------------
Default.aspx
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="Default" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head id="Head" runat="server">
<title>Say Hello</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
</head>
<body>
<form id="form" runat="server">
<asp:Label ID="lb1" runat="server" Text=""></asp:Label>
</form>
</body>
</html>
.cs
using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
public partial class Default : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
lb1.Text="Hello! 这是一个Hello的例子。";
}
}
------解决方案--------------------
Inherits="IWMS.Pages.TempTrans"
被编译了
------解决方案--------------------
源:
<asp:Button ID="Button2" runat="server" Text="修改我的资料" OnClick="Button2_Click" />
CS:
protected void Button2_Click(object sender, EventArgs e)
{
Response.Write("hello world!");
}
------解决方案--------------------