我Page_Load方法是這樣的:的Response.Redirect(Request.Url.AbsoluteUri)不更新頁面數據
private void Page_Load(object sender, System.EventArgs e)
{
if (!IsPostBack)
{
// Load Content
LoadContent();
return;
}
// some code here
}
而且我用Response.Redirect(Request.Url.AbsoluteUri)
在方法結束,以防止套管重職的行動頁面折射。當我從運行良好的源代碼(調試或運行模式)運行我的應用程序時,但是當我發佈應用程序(即使在同一臺計算機上)頁面數據(LoadContent上加載的頁面數據)未在更新的頁面上更新(但是重新發布行動被阻止)。
請問誰能告訴我爲什麼會發生?
ADDED:
有LoadContent()
方法:
// firstly I get an supervisedGroups list TIBCO iProcess Engine via .NET vendor library, and then:
if (supervisedGroups != null)
{
rptSupervisedGroups.DataSource = supervisedGroups; // rpt.. is Repeater
rptSupervisedGroups.DataBind();
}
ADDED:
方法,其中的Response.Redirect被使用:
private void removeFromGroup(string strGroupName)
{
using(SqlConnection con = DBHelper.GetNewConnection())
{
con.Open();
// here comes query to DB
}
// Reload Page
Response.Redirect(Request.Url.AbsoluteUri);
}
你正在更新什麼樣的數據,以及如何?向我們顯示該代碼。你在哪裏調用Response.Redirect? – Alexander
可能與客戶端頁面的緩存有關。如果你按Shift +重新加載他們更新? – Aristos
@Aristos數據更新即使我只是按F5,但沒有Response.Redirect –