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

Posted on 2009-02-12
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 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
Question by:RFExpert
    1 Comment
    LVL 9

    Accepted Solution

    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:

    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)

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    6 Surprising Benefits of Threat Intelligence

    All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

    In my previous article ( we saw the basics of serialization and how types/objects can be serialized to Binary format. In this blog we wi…
    Wouldn’t it be nice if you could test whether an element is contained in an array by using a Contains method just like the one available on List objects? Wouldn’t it be good if you could write code like this? (CODE) In .NET 3.5, this is possible…
    This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA.…
    Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…

    759 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    10 Experts available now in Live!

    Get 1:1 Help Now