• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 427
  • Last Modified:

Have master pg setup as a usercontrol. Within masterpage have a grid control for use as a page container. When master pg loads, would like to know in VB how to load another user control in pg conta

Have master page setup as a usercontrol.  Within the masterpage have a grid control for use as a page container.   When master pg loads, would like to know in VB.net how to load another user control inside the page container.  Such as a login form.  Then need the ability to execute code and if login is successful, switch out the user control within the master for another usercontrol.  Using Silverlight 2 and vb.net
0
RFExpert
Asked:
RFExpert
1 Solution
 
peterdunganCommented:
This is the basic logic for swapping pages. It's in c# but it should be easy enough to rewrite it in vb:

        public masterpage()
        {            if (contentgrid.Content == null)
            {
                contentgrid.Content = new logincontrol();
            }
        }
       public void Navigate(UserControl nextPage)
        {
            contentgrid.Content = nextPage;
        }

There are plenty of login controls available for silverlight. Here is one: http://www.telerik.com/community/code-library/silverlight/general/simple-login-control.aspx

To execute code after login you should put it in the method namd similar to webservice_logincompleted, which is the event handler for when the login service method has completed. (So you'd put the call to the navigate method here to load in whatever control you wanted)
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Cloud Class® Course: Microsoft Exchange Server

The MCTS: Microsoft Exchange Server 2010 certification validates your skills in supporting the maintenance and administration of the Exchange servers in an enterprise environment. Learn everything you need to know with this course.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now