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!
Asked
Active
Viewed 86 times
1
-
are not asp.net 4.0 and mvc 3 completely different things? – naveen Aug 15 '11 at 07:24
-
2@naveen - Yes, different things. But he is right - MVC3 uses .NET 4.0 features. – Oded Aug 15 '11 at 07:30
-
see n feel a difference.[link](http://www.mindstick.com/Blog/185/Difference%20between%20ASP%20NET%20and%20ASP%20NET%20MVC) – 4b0 Aug 15 '11 at 07:31
-
@Badz: are you rolling out your own authentication or using a the default forms authentication? – naveen Aug 15 '11 at 07:36
-
Using default form authentication by mvc3. The problem is I'm not sure how to or what should I do to have something from the 2.0 program to be authenticated by the mvc3 page – Badz Aug 15 '11 at 07:52
-
please post exact error you recieving, do you have YoD ? – Alexander Beletsky Aug 15 '11 at 08:19
-
Look at the following link: http://stackoverflow.com/questions/554094/asp-net-mvc-adding-to-the-authorize-attribute – Varun Chatterji Aug 15 '11 at 08:57
-
No I have no errors, I'm just asking if someone has tried. I'm looking for an idea – Badz Aug 15 '11 at 08:57
1 Answers
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