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
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
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
Vuyiswa Maseko, Few companies that installed computers to reduce the employment of clerks have realized their expectations.... They now need more and more expensive clerks even though they call them "Developers" or "Programmers." C#/VB.NET/ASP.NET/SQL7/2000/2005/2008 http://www.vuyiswamaseko.tiyaneProperties.co.za vuyiswa@its.co.za http://www.itsabacus.co.za/itsabacus/
-
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
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
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
Vuyiswa Maseko, Few companies that installed computers to reduce the employment of clerks have realized their expectations.... They now need more and more expensive clerks even though they call them "Developers" or "Programmers." C#/VB.NET/ASP.NET/SQL7/2000/2005/2008 http://www.vuyiswamaseko.tiyaneProperties.co.za vuyiswa@its.co.za http://www.itsabacus.co.za/itsabacus/
use button as asp:button and it will do a postback call where you can do whatever you want.
Prince www.imaginethinkact.com
-
use button as asp:button and it will do a postback call where you can do whatever you want.
Prince www.imaginethinkact.com
I really don't understand what you just wrote , can you please explain clearer ? :)
Vuyiswa Maseko, Few companies that installed computers to reduce the employment of clerks have realized their expectations.... They now need more and more expensive clerks even though they call them "Developers" or "Programmers." C#/VB.NET/ASP.NET/SQL7/2000/2005/2008 http://www.vuyiswamaseko.tiyaneProperties.co.za vuyiswa@its.co.za http://www.itsabacus.co.za/itsabacus/
-
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
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
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
Vuyiswa Maseko, Few companies that installed computers to reduce the employment of clerks have realized their expectations.... They now need more and more expensive clerks even though they call them "Developers" or "Programmers." C#/VB.NET/ASP.NET/SQL7/2000/2005/2008 http://www.vuyiswamaseko.tiyaneProperties.co.za vuyiswa@its.co.za http://www.itsabacus.co.za/itsabacus/
ActivityCtrl1.load_Again(); Is this written on Page_Load of your aspx page?
-
ActivityCtrl1.load_Again(); Is this written on Page_Load of your aspx page?
Yes and declared Public in the User Control
Vuyiswa Maseko, Few companies that installed computers to reduce the employment of clerks have realized their expectations.... They now need more and more expensive clerks even though they call them "Developers" or "Programmers." C#/VB.NET/ASP.NET/SQL7/2000/2005/2008 http://www.vuyiswamaseko.tiyaneProperties.co.za vuyiswa@its.co.za http://www.itsabacus.co.za/itsabacus/
-
Yes and declared Public in the User Control
Vuyiswa Maseko, Few companies that installed computers to reduce the employment of clerks have realized their expectations.... They now need more and more expensive clerks even though they call them "Developers" or "Programmers." C#/VB.NET/ASP.NET/SQL7/2000/2005/2008 http://www.vuyiswamaseko.tiyaneProperties.co.za vuyiswa@its.co.za http://www.itsabacus.co.za/itsabacus/
Can you put this code (for LoadAgain()) inside the page load event of user control? If it is a dynamic user control, it needs to be regenerated on post back of page. Thanks & Regards, Nyoti
-
Can you put this code (for LoadAgain()) inside the page load event of user control? If it is a dynamic user control, it needs to be regenerated on post back of page. Thanks & Regards, Nyoti
After the button has been clicked i have Forced a Postback by doing this
response.redirect("Subjectscruct.aspx",false");
and it worked, is this an efficient way ? Thank you
Vuyiswa Maseko, Few companies that installed computers to reduce the employment of clerks have realized their expectations.... They now need more and more expensive clerks even though they call them "Developers" or "Programmers." C#/VB.NET/ASP.NET/SQL7/2000/2005/2008 http://www.vuyiswamaseko.tiyaneProperties.co.za vuyiswa@its.co.za http://www.itsabacus.co.za/itsabacus/
-
After the button has been clicked i have Forced a Postback by doing this
response.redirect("Subjectscruct.aspx",false");
and it worked, is this an efficient way ? Thank you
Vuyiswa Maseko, Few companies that installed computers to reduce the employment of clerks have realized their expectations.... They now need more and more expensive clerks even though they call them "Developers" or "Programmers." C#/VB.NET/ASP.NET/SQL7/2000/2005/2008 http://www.vuyiswamaseko.tiyaneProperties.co.za vuyiswa@its.co.za http://www.itsabacus.co.za/itsabacus/
If the button is in the page, I am not sure why it was needed to execute Postback forcefully? Did you try debugging on the page load on the click of button to check if the control comes there? Thanks, Nyoti