We help IT Professionals succeed at work.

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

Medium Priority
440 Views
Last Modified: 2013-11-12
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
Comment
Watch Question

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)

Not the solution you were looking for? Getting a personalized solution is easy.

Ask the Experts
Access more of Experts Exchange with a free account
Thanks for using Experts Exchange.

Create a free account to continue.

Limited access with a free account allows you to:

  • View three pieces of content (articles, solutions, posts, and videos)
  • Ask the experts questions (counted toward content limit)
  • Customize your dashboard and profile

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.