1
我有一個應用程序,其中一個javascript讀取設備的GPS位置,並將其發送到服務器端腳本是這樣的:AJAX.NET __doPostBack改變其他內容
f()
{
var initialLocation= Someshit();
document.getElementById('<% = text.ClientID %>').value=initialLocation;
var button = document.getElementById('<% = Button4.ClientID %>');
button.click();
}
,我有一些AJAX.NET代碼:
<asp:UpdatePanel ID="UpdatePanel1" runat="server">
<ContentTemplate>
<asp:Button ID="Button4" runat="server" Text="PlaceHolder" onclick="Button4_Click"/>
<asp:TextBox ID="text" runat="server"></asp:TextBox>
</ContentTemplate>
</asp:UpdatePanel>
,有點進一步下跌
<asp:UpdatePanel ID="UpdatePanel2" runat="server">
<ContentTemplate>
<div>
<some divs and asp:gridviews and god knows what >
</div>
<ContentTemplate>
</asp:UpdatePanel>
的問題是,當UpdatePanel1的情況下完成了最後的div內的內容變化。這是爲什麼?我不希望UpdatePanel1以外的內容被更改。請幫忙。
我想你也需要在你調用UpdatePanel2.Update()代碼隱藏更新面板,以及,我覺得... – Mantorok 2010-05-26 14:59:47
@Mantorok - 依賴時,他不* *想要更新,爲此添加了相關文檔,如果他只想在它內部的控件導致它更新時更新,那麼這是照顧...但是當從外部更新時需要調用'.Update()'。 – 2010-05-26 15:02:55
謝謝你Craver,工作就像一個魅力 – Raul 2010-05-26 15:11:54