I have a user control loaded on the default.aspx page using the
Control UControl = null;
UControl = this.LoadControl("UserControl1.ascx");
UControl.ID = UControl.GetType().Name;
panel1.Controls.Add(UControl);
Now I want to refresh only the content of the user control not all the page.
I already used
<meta http-equiv="refresh" content="300">
and
Response.AppendHeader("Refresh", "2");
But these are refreshing the entire default.aspx page.
How I can only refresh the user control without refreshing the default.aspx.
You need to look into the
<asp:UpdatePanel>control. You can use it with a timer as well to auto refresh, or hook it into a trigger such as button or link.Try here on the offical asp.net site:
But a simple search will also produce plenty of tutorials.