Click here to Skip to main content
15,884,237 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
I'm creating Index Page with the Login button for different login users like Agent and user.
so give an idea that how could I differentiate them?
Posted

Assign them with different roles: Walkthrough: Managing Web Site Users with Roles[^]
 
Share this answer
 
If this is web forms then give each button its own click event and you'll know which was clicked by the event that is fired. If mvc then look at the Request.Form["XYZ"] where XYZ is the name of the respective buttons, and the one that isn't empty is the one that was clicked

<input type="submit" name="LoginAgent" value="Login"/>
<input type="submit" name="LoginUser" value="Login"/>

// in your code

if (!string.IsNullorWhiteSpace(Request.Form["LoginAgent"]))
{
    // agent login clicked
}


You can also use the above technique with webforms if you don't want to use click events.

Edit: sorry, above is in c# and not vb.net but you get the gist, it's easy to convert it
 
Share this answer
 
v2
thank you F-ES Sitecore and Peter Leow
 
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