Actually i am trying to update a page without refresh of whole page i.e. Partial Page Update. Web page structure is
<%@ Page Title="Test Page" Language="C#" AutoEventWireup="true" CodeBehind="Test.aspx.cs" Inherits="WebApp.Test" %>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
</head>
<body>
<form id="form1" runat="server">
<div>
<asp:ScriptManager runat="server"></asp:ScriptManager>
<asp:DropDownList AutoPostBack="true" ID="dropDownName" runat="server"></asp:DropDownList>
<asp:UpdatePanel ID="UpdatePanel" runat="server">
<ContentTemplate>
Last update: <%=DateTime.Now.ToString() %>
<asp:PlaceHolder ID="PlaceHolder1" runat="server"></asp:PlaceHolder>
</ContentTemplate>
</asp:UpdatePanel>
</div>
</form>
</body>
</html>
Now i can see that when ever my event fires, it does every thing right like reading the contents, updating the controls on page with right updated information and adding the contents webControls to place holder like this
void Contnt_Update(object sender)
{
PlaceHolder1.Controls.Add(newLabel);
}
but it just simply not updating the 'Views' (mean i don't see the updated info on the web page) nor it updates the Time of 'Last Update'. Any idea what i am doing wrong? Any help will be really appreciated because i have spent quite good time on it and not getting any where ..
You could try to force the update with: UpdatePanel.Update();
, and follow the other recommendations given here: ASP.NET refresh Update Panel
Update: Another technique to force the refresh of the UpdatePanel, without any action from the user, is to include a Timer in the panel, as suggested here.