Click here to Skip to main content
15,904,024 members
Please Sign up or sign in to vote.
2.00/5 (2 votes)
See more:
I have 3 types of user in my application.
for that i have two different login pages when user login i am  create Session on the login and i am using 3 master pages. like this:
Master1, Master2, Master3

for usertype A and B login pages is login.aspx
for usertype C i have login page loginC.aspx 

but master page i am using for these user are like this:
for A and B Master pages's are Master1, Master2, Master3
for C  Master pages are Master1, Master2, Master3

i am creating session UserType on each login page 
if session is not alive then all user are by default redirecting to login.aspx.
i am not able to distinguish how i can differentiate login page's.
even i tried with cookies :
i created cookies on each login page's and read them on the master page and on master page i assign to the session. but not working. coz when i am redirecting to the my home page then
 home page Page-load method get call first then master page page-load.

any suggestion or solution ....??

Thanks in advance...!!
Posted
Updated 25-Jul-13 1:10am
v4

When you LogIn check the Session you have created,if it is not created than redirect to LogIn page. During LogOut clear all session you have created by using Session.Abandon()
 
Share this answer
 
Comments
OPees 25-Jul-13 6:31am    
but my problem is how to detect user type when session is null.
RomilGandhi 25-Jul-13 6:42am    
Can you please explain in detail,i am not getting your point.
OPees 25-Jul-13 7:09am    
When i login Session Get created... and works...!! on logout button i m using Session.Abandon() to clear all the values. i put my session timeout: 360.
but when my session is Expires that time its by default goes to login.aspx
i want when session expires for usertype A and B it should go on login.aspx.
for usertype C it should go to loginC.aspx....
RomilGandhi 25-Jul-13 7:18am    
than create two session for different usertype and check according to that
OPees 25-Jul-13 23:48pm    
OK, When session Expires then?
You cannot detect the user type unless User has signed in into your system.
You can try to provide a control like radio button or drop down for all user types A, B and C. Now depending upon the selection made by the user at the time of logging in you can display the intended master page programatically.
 
Share this answer
 
Comments
OPees 25-Jul-13 7:23am    
have you read all the comments?
Yes have read all the comments.
Think of a real world example like you want to provide question papers to students appearing for examinations. Now unless you are aware of their courses how can you provide them with the relevant question papers, for example: you will ask student whether they have appeared for MBA exam or BTech exam or MTech exam.....
Now after student will tell you the exact course for which they are giving examination you will be able to server them with appropriate question paper.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900