Click here to Skip to main content
15,740,731 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have created a mvc3 web site.
how to restrict copy and past url in another browser directly it should not open that must and should redirect to Login page.

i need the code how to do it in MVC3.
Jameel VM 6-Aug-13 2:39am    
did you try authorizarion?

1 solution

Share this answer
DGKumar 6-Aug-13 2:58am    
Thank u for reply
I have used in Application this technique "A Beginner's Tutorial on Custom Forms Authentication in ASP.NET MVC Application[^]"
But some controller action are displaying error pager while copy and past into another browser.
i got this error like "System.InvalidOperationException: Sequence contains no elements".

which is best one
string UserName = HttpContext.User.Identity.Name;
or string UserName=session["UserName"];

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