110,570
社区成员
发帖
与我相关
我的任务
分享
<%@ Master Language="C#" AutoEventWireup="true" CodeBehind="index.master.cs" Inherits="WebApplication3.index" %>
<!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>
<asp:ContentPlaceHolder ID="ContentPlaceHolder1" runat="server">
</asp:ContentPlaceHolder>
<asp:Button ID="btnOK" runat="server" Text="Test" OnClick="btnOK_Click" />
</div>
</form>
</body>
protected void Page_Load(object sender, EventArgs e)
{
}
protected void btnOK_Click(object sender, EventArgs e)
{
WebApplication3.WebForm6 wf = (WebApplication3.WebForm6)(this.FindControl("ContentPlaceHolder1").Controls[0].BindingContainer);
wf.Test();
}
<%@ Page Language="C#" MasterPageFile="~/index.master" AutoEventWireup="true" CodeBehind="WebForm6.aspx.cs" Inherits="WebApplication3.WebForm6" Title="无标题页" %>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
</asp:Content>
public partial class WebForm6 : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
//
}
public void Test()
{
Response.Write("<script>alert('webform6.aspx');</script>");
}
}