Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

login page

Posted on 2011-09-08
15
Medium Priority
?
261 Views
Last Modified: 2013-12-17
Hi Experts

I've looked at the Business Application for silverlight 4 and i dont want to use the out of box login structure, is there a way i can create my own login page (even using a blank project) that will then load up main page after login successful?

Thanks
0
Comment
Question by:razza_b
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 8
  • 3
  • 2
15 Comments
 
LVL 83

Expert Comment

by:David Johnson, CD, MVP
ID: 36525528
Under models: you can change the logininfo.cs, registrationdata.partial.cs, user.partial.cs to whatever you want,

you also have to change the views *.xaml  to match
0
 
LVL 1

Author Comment

by:razza_b
ID: 36526195
Hi

ok i'll have a look, so would it be possible to load up a login page first, then when successful the mainpage can then load?

Thanks
0
 
LVL 1

Author Comment

by:razza_b
ID: 36528337
also if using out of box login functionality could i modify it to query forms authentication against the DB? or windows authentication so that...

1. project opens up with login page
2. if successful main page will display user data functionality
3  if fails then no main page

at the moment i have taken the Business app and changed the design, i have two content areas on the mainpage - navigation section(populated by user roles queried on sp of username) on left and content section on right(child node selection opens up related page). Im not using the login at the moment.

or

with the design i have keep login container at top of mainpage so..

1  mainpage loads up with no mainpage functionality(nav & content sections blank), just login link section at top.
2. I login and if successful i want to populate navigation content based on username.(so i would need to store username after login to pass to sp to populate tree navigation)

Thanks
0
Will your db performance match your db growth?

In Percona’s white paper “Performance at Scale: Keeping Your Database on Its Toes,” we take a high-level approach to what you need to think about when planning for database scalability.

 
LVL 1

Author Comment

by:razza_b
ID: 36528365
i have attached a screenshot of modified business app mainpage without using login and top section would contain login if it can work for me.

Tree would'nt be populated until successful login.


business-app-mainpage-modified.docx
0
 
LVL 83

Expert Comment

by:David Johnson, CD, MVP
ID: 36528440
should work.. just a variable i.e. IsUserLoggedIn (true/false) If you are familiar with coding in MVC then this should be easy as it is basically the same
0
 
LVL 1

Author Comment

by:razza_b
ID: 36528502
i'm not familiar with MVC at all, just trying to get used to silverlight.

so if i had everything hidden on mainpage i.e. tree nav and content and just had login at the top, could i store the username in app.xaml.cs if successful, then once logged in then pass usename to sp and show components for tree nav?

0
 
LVL 1

Author Comment

by:razza_b
ID: 36528508
how would i set up forms auth to query my db using login structure?
0
 
LVL 1

Expert Comment

by:philsmicronet
ID: 37010663

The way I handle this is in the app.cs I add the following

       private void Application_Startup(object sender, StartupEventArgs e)
        {
            // Load the main control
            Grid root = new Grid();
            root.Children.Add(new Page());
            this.RootVisual = root;
        }

This creates a new Grid which becomes the Root of the visual tree. You then add your login page to this.

Then once you have completed the login, just do the following

    public static void Navigate(UserControl newPage)
    {
        Grid root = Application.Current.RootVisual as Grid;
        UserControl oldPage = root.Children[0] as UserControl;

        root.Children.Insert(0, newPage);
        root.Children.Remove(oldPage);
    }
0
 
LVL 1

Author Comment

by:razza_b
ID: 37023390
Hi philsmicronet

Thanks for reply where does the navigate code go?

I had added it to the login window code but the login page wouldnt go away after the main page appears.

Thanks
0
 
LVL 1

Expert Comment

by:philsmicronet
ID: 37023537
Here is some sample code.
c:\download\testapp.zip

Open in new window

0
 
LVL 1

Author Comment

by:razza_b
ID: 37023553
did you forget to attach :)
0
 
LVL 1

Accepted Solution

by:
philsmicronet earned 2000 total points
ID: 37023590
0
 
LVL 1

Author Comment

by:razza_b
ID: 37023702
perfect thanks very much! :)
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

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

Australian government abolished Visa 457 earlier this April and this article describes how this decision might affect Australian IT scene and IT experts.
Without even knowing it, most of us are using web applications on a daily basis.  In fact, Gmail and Yahoo email, Twitter, Facebook, and eBay are used by most of us daily—and they are web applications. We generally confuse these web applications to…
Any person in technology especially those working for big companies should at least know about the basics of web accessibility. Believe it or not there are even laws in place that require businesses to provide such means for the disabled and aging p…
The viewer will receive an overview of the basics of CSS showing inline styles. In the head tags set up your style tags: (CODE) Reference the nav tag and set your properties.: (CODE) Set the reference for the UL element and styles for it to ensu…

722 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