|
code
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Web User ControlHi,
I have two user controls. They are small. One is for login in and the other one is for a new user. I was thinking to have both, and in the client side, switch them (if both are load it), yet I want them in the same position. How can I achieve that? and if is not possible on client side, at least on server side Thanks Francisco I found a way of doing it using
((MSAWeb.WUCNewUser)(this.Page.FindControl("WUCNewUser1"))).Visible = false; Now, I wonder how can I do it at the client side. At the same time, I was thinking that there may be a way to load it instead of using the visible properties. That way, I don't overload the user controls. If I cna do to this at the server level, it could be quite useful. Thanks Show quoteHide quote "Frank" wrote: > Hi, > I have two user controls. They are small. One is for login in and the > other one is for a new user. I was thinking to have both, and in the client > side, switch them (if both are load it), yet I want them in the same > position. How can I achieve that? and if is not possible on client side, at > least on server side > Thanks > Francisco > You could have also referenced the control directly if you had declared it
this way: public class MyPage: System.Web.UI.Page { protected MSAWeb.WUCNewUser WUCNewUser1 ; //..rest of the page code private void Page_Load(object sender, System.EventArgs e) { WUCNewUser1.Visible = false; } } You can load your control server-side using the LoadControl method: http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/frlrfsystemwebuitemplatecontrolclassloadcontroltopic.asp To manipulate an object using client-side JavaScript you need to identify one more piece of information; the clientID(s) of the HTML object(s) rendered by your control, which, though possible, is not a preferred approach. http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/frlrfsystemwebuicontrolclassclientidtopic.asp Show quoteHide quote "Frank" wrote: > I found a way of doing it using > ((MSAWeb.WUCNewUser)(this.Page.FindControl("WUCNewUser1"))).Visible = false; > > Now, I wonder how can I do it at the client side. At the same time, I was > thinking that there may be a way to load it instead of using the visible > properties. That way, I don't overload the user controls. If I cna do to this > at the server level, it could be quite useful. > Thanks > > > "Frank" wrote: > > > Hi, > > I have two user controls. They are small. One is for login in and the > > other one is for a new user. I was thinking to have both, and in the client > > side, switch them (if both are load it), yet I want them in the same > > position. How can I achieve that? and if is not possible on client side, at > > least on server side > > Thanks > > Francisco > >
Error: Content is not allowed between the opening and closing tags for element
Invalid FORMATETC structure (Exception from HRESULT: 0x80040064(DV_E_FORMATETC)) How to Catch exception for GridView control? Menu displays I-Beam cursor, not Hand GridViewUpdateEventArgs not including complete set of OldValues and NewValues DropDownList resets selectedIndex on postback object reference not set as an instance of an object EnableViewState=False creates problems with Visible & Enabled Need Help: AccessDataSource and Assigning Variables for Data (ASP 2.0) Communicating between windows control and web page |
|||||||||||||||||||||||