views:

38

answers:

1

Hello,

I am developing a Silverlight 4 application which is based upon Business Application Template.

I am interested to ask user to login and display a login form as soon as user arrives to my site. I need to makes sure that the user cannot see/navigate to any other page of the application until he/she logs in.

Could you please help me achieve this functionality?

Thanks :)

A: 

How about adding the following in your Home.xaml.cs.

        LoginRegistrationWindow loginWindow = new LoginRegistrationWindow();
        loginWindow.Show();

This will just prompt the user. You can check the status of whether he is logged on or not using the code in LoginStatus.xaml.cs

Rahul Soni
I tried it. But login form doesn't get displayed for some reason.
Ruby
Try this... create a new Business Application, and just browse it. Then click on the Login button on top right and verify if that comes up. If that comes up good, you should be able to use this code from anywhere inside the project.
Rahul Soni