How to Refresh the UserControl not the Whole Page In ASP.net
Good Day All
I have a UserControl in my page. i want to Reload it and refresh it everytime i click a Button, i only want it to be refreshed not the whole page. at the moment i force the postback with the
Code:
response.Redirect("mycurrentpage.aspx");
Its working but the Page Flickers a Lot.
Thanks
Re: How to Refresh the UserControl not the Whole Page In ASP.net
3 Attachment(s)
Re: How to Refresh the UserControl not the Whole Page In ASP.net
Good Morning
I have the Following User Control in the Pic "UserControl_Design_Mode.JPG" and i have the Following code to enable Partial Rendering
UserControl_Design_Mode.JPg
http://www.vbforums.com/attachment.p...1&d=1242799933
Code:
/*Enabling Partial */
[DefaultValueAttribute(true)]
[CategoryAttribute("Behavior")]
public bool EnablePartialRendering { get; set; }
Am exposing the Properties of a usercontrol like like this
Code:
public UpdatePanelUpdateMode UpdateMode
{
get
{
return this.UpdatePanel1.UpdateMode;
}
set
{
this.UpdatePanel1.UpdateMode = value;
}
}
And there are of them
and i went to the Hosting page we have a pic
http://www.vbforums.com/attachment.p...1&d=1242800293
for Example, in the Button Remove i have Finally something like this
Code:
Response.Redirect("SubjectStaff.aspx", false); //Refresh the Page again
I was Forcing a Postback and the Whole Page flickers, i want to Refresh only the UserControl.
i tried the Following instead of the above statement
http://www.vbforums.com/attachment.p...1&d=1242800630
Here am trying to call the name of the usercontrol first and then the Properties it exposes, but i only get the load and load1 event , it seems every is hiden now since i have taken the Control inside the Update Paanel in the User Control.
Can you Help me in that Regard
Thanks
Re: How to Refresh the UserControl not the Whole Page In ASP.net
Hey,
To be honest, I haven't really yet played with the UpdatePanel, I simply know about it's existence, and the tutorial I linked to sounded like it would have exactly what you needed. My best guess would be that the UpdatePanel is a Control Container, and as such you will need to use the FindControl method to first locate the control that you want, cast it as the correct type, and then you can access the properties that you have on it.
Hope that helps!!
Gary
Re: How to Refresh the UserControl not the Whole Page In ASP.net
That is true, it seems after adding the Update panel i could not even use the name of usercontrol to do that as you seen in the pic.
Re: How to Refresh the UserControl not the Whole Page In ASP.net
Hey,
I would try the FindControl method and see how you get on. I think this should resolve your issue.
I one concern that I might have is that I don't though enough about the best practices surrounding UpdatePanel and I don't know whether you should be using this method. i.e. should the information you are wanting to add not already exist in the update panel as well.
Gary
Re: How to Refresh the UserControl not the Whole Page In ASP.net
Thanks, for the meant time i will keep on finding some results in google