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
Medium Priority
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
Question by:RFExpert
1 Comment

Accepted Solution

peterdungan earned 2000 total points
ID: 23640375
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)

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

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…
Hello there! As a developer I have modified and refactored the unit tests which was written by fellow developers in the past. On the course, I have gone through various misconceptions and technical challenges when it comes to implementation. I would…
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. http://www.experts-exchange.com/videos/1478/Excel-Error-Handlin…
When cloud platforms entered the scene, users and companies jumped on board to take advantage of the many benefits, like the ability to work and connect with company information from various locations. What many didn't foresee was the increased risk…

621 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