[RESOLVED] How to ReFresh a user Control
i have a userControl and am using it in a aspx page, now i have expose the Following Method that reside in the usercontrol like this
Code:
public void load_Again()
{
string clientscript = "";
// make available to all subcontrols a variable with the client ID of the textbox in which to store the selected activity IDs
clientscript = "var txtbxActvClientID = '" + txtbxActvs.ClientID.ToString() + "'; ";
// assign the current list of selected activities to the list for JavaScript here
//clientscript += "var ActivityList = String(\"" + txtbxActvs.Text + "\"); ";
ClientScriptManager cs = Page.ClientScript;
cs.RegisterClientScriptBlock(this.GetType(), "txtbxlookupid", clientscript, true);
HighlightSelectedActvs();
}
and am calling it on my aspx page like this
Code:
ActivityCtrl1.load_Again();
i have Copied the code you see in the method load_Again() from the page load event of the Control. I want refresh or load the page again after i click a button in my aspx page.
Thank you
Re: How to ReFresh a user Control
Wrap this around your control...
<a href="#" onclick="location.reload(true)">CONTROL HERE</a>
Its a JavaScript call that will provide the functionality I think you are looking for
Hope this helps,
Larry Darrah
MS Architect Evangelist
Re: How to ReFresh a user Control
Thank you very much, this Did the Work
Thanks
Re: [RESOLVED] How to ReFresh a user Control
Thanks buddy, but i still have a Problem.
How do i use the Javascript you gave me in ASp.net. i tried io implement it like this on a Button Click event
Code:
Response.Write("<script><a href='SubjectStaff.aspx' onclick='location.reload(true)'>'ActivityCtrl.ascx'</a></script>");
Thanks