1

We have an existing application written in asp.net 2.0. Then we created a new module using mvc3 which is obviously asp.net 4.0. Is there someone who tried having authentication from 2.0 submitted to the mvc3 site to be able to access the mvc3 page? Thanks!

Badz
  • 47
  • 1
  • 11

1 Answers1

0

Look at the following link: asp.net mvc Adding to the AUTHORIZE attribute

It should answer your question.

Basically you have to create an attribute class derived from AuthorizeAttribute

And then you can use this attribute with your controller class like:

[YourAuthorization(Roles = "Admin", ViewName="AccessDenied")]
public class YourControllerController : Controller
Community
  • 1
  • 1
Varun Chatterji
  • 5,059
  • 1
  • 23
  • 24