我刚发现利用Atlas实现无刷新,只要有母版页就不好使,谁知道为什么?我的代码MasterPage.master<%@ Master Language="C#" AutoEventWireup="true" CodeFile="MasterPage.master.cs" Inherits="a_MasterPage" %><!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>
<div>
<asp:contentplaceholder id="ContentPlaceHolder1" runat="server">
</asp:contentplaceholder>
</div>
</body>
</html>
1.aspx<%@ Page Language="C#" MasterPageFile="MasterPage.master" AutoEventWireup="true" CodeFile="1.aspx.cs" Inherits="a_1" Title="Untitled Page" %>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server"> <form id="form1" runat="server">
<atlas:ScriptManager ID="ScriptManager1" runat="server" EnablePartialRendering=true />
<atlas:UpdatePanel runat="server" ID="UpdatePanel1" Mode="Conditional">
<ContentTemplate>
<asp:Label ID="PartialPostBackLabel" runat="server" />
<asp:Button ID="PartialPostBackButton" runat="server" Text="页面 部分进行回发" OnClick="PartialPostBackButton_OnClick" />
</ContentTemplate>
</atlas:UpdatePanel>
</form>
</asp:Content>
1.aspx.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 a_1 : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{ } protected void PartialPostBackButton_OnClick(object sender, EventArgs e)
{
PartialPostBackLabel.Text = DateTime.Now.ToString();
}
}
<head runat="server">
<title>无标题页</title>
</head>
<body>
<div>
<asp:contentplaceholder id="ContentPlaceHolder1" runat="server">
</asp:contentplaceholder>
</div>
</body>
</html>
1.aspx<%@ Page Language="C#" MasterPageFile="MasterPage.master" AutoEventWireup="true" CodeFile="1.aspx.cs" Inherits="a_1" Title="Untitled Page" %>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server"> <form id="form1" runat="server">
<atlas:ScriptManager ID="ScriptManager1" runat="server" EnablePartialRendering=true />
<atlas:UpdatePanel runat="server" ID="UpdatePanel1" Mode="Conditional">
<ContentTemplate>
<asp:Label ID="PartialPostBackLabel" runat="server" />
<asp:Button ID="PartialPostBackButton" runat="server" Text="页面 部分进行回发" OnClick="PartialPostBackButton_OnClick" />
</ContentTemplate>
</atlas:UpdatePanel>
</form>
</asp:Content>
1.aspx.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 a_1 : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{ } protected void PartialPostBackButton_OnClick(object sender, EventArgs e)
{
PartialPostBackLabel.Text = DateTime.Now.ToString();
}
}
网上也都搜遍了,就两三篇是原创的,其他全是转载/抓取的,悲哀!
谁能帮我看看呀,谢谢了!