Home All Groups Group Topic Archive Search About
Author
31 Jan 2006 8:58 PM
Frank
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

Author
31 Jan 2006 9:22 PM
Frank
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
>
Author
31 Jan 2006 10:49 PM
Phillip Williams
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
> >