AJAX.NET __doPostBack changes other content
Posted
by Raul
on Stack Overflow
See other posts from Stack Overflow
or by Raul
Published on 2010-05-26T14:56:03Z
Indexed on
2010/05/26
15:01 UTC
Read the original article
Hit count: 345
Hi. I have an application where a javascript reads the GPS location of the device and sends it to serverside script like this:
f()
{
var initialLocation= Someshit();
document.getElementById('<% = text.ClientID %>').value=initialLocation;
var button = document.getElementById('<% = Button4.ClientID %>');
button.click();
}
And i have some AJAX.NET code:
<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>
And a bit further down
<asp:UpdatePanel ID="UpdatePanel2" runat="server">
<ContentTemplate>
<div>
<some divs and asp:gridviews and god knows what >
</div>
<ContentTemplate>
</asp:UpdatePanel>
The problem is that the the last divs inner content changes when the event of UpdatePanel1 has finished. Why is that? I don't want the content outside of UpdatePanel1 to be changed whenever UpdatePanel1 is doing its thing. Please help.
© Stack Overflow or respective owner