I am working on asp.net, C# web application.
Working on my main page in application, where all the codes are synchronize and works well.
Now, I need to change some of the functionality using ajax JQuery Asyn. calls. In my case it works for me. everything is fine.
Now my page is having asp.net AjaX Timer Control which gets fire at every one minute. This is one of the functionality which is need to be there and not able to change using jQuery.
Now, when my timer event (Tick) fires at every one minute, my dynamically filled div ( html() of ajax jquery) gets blank when page gets postback.
i.e. consider my page having div with id = div1, and this gets filled with ajax jQuery call which returns me html of remote page, so the content of that is totally dynamic.
When page gets fired, that div is blank..
How can I keep my div’s to be as it is when my page gets post back?
(think this is possible as Gmail works on the same thing, how they mantain?)
Please let me know if require more details if not clear.
Below is the image with ajax call.

now, when pages gets postback, it is something like below….

it is not possible for me to give complex code here, how ever i give a sample code here by.
<asp:ScriptManager ID="Scriptmanager1" runat="server">
</asp:ScriptManager>
<asp:Timer ID="Timer1" runat="server" Interval="5000" OnTick="Timer1_Tick" Enabled="true">
</asp:Timer>
<div>
<asp:Button Text="text" runat="server" OnClientClick="callfun();return false;" />
</div>
<asp:Button Text="text" runat="server" ID="btn" OnClick="btn_Click" />
<div id="div1">
</div>
<script>
});
function callfun() {
$("#div1").html("test me, test me");
}
</script>
code behind…..
protected void Page_Load(object sender, EventArgs e)
{
}
protected void btn_Click(object sender, EventArgs e)
{
Response.Write("postback");
}
protected void Timer1_Tick(object sender, EventArgs e)
{
System.Threading.Thread.Sleep(2000);
}
Please use
pageLoad(). It gets fired after each update panel refresh.And forget gmail for now. They do not have a Sys is undefined 🙂