ASP MVC C#: Is it possible to pass dynamic values into an attribute?
Posted
by wh0emPah
on Stack Overflow
See other posts from Stack Overflow
or by wh0emPah
Published on 2010-05-09T17:34:12Z
Indexed on
2010/05/09
17:38 UTC
Read the original article
Hit count: 234
Okay I'm very new to C# and i'm trying to create a little website using ASP MVC2.
I want to create my own authorization attribute. but i need to pass some values if this is possible.
For example:
[CustomAuthorize(GroupID = Method Parameter?]
public ActionResult DoSomething(int GroupID)
{
return View("");
}
I want to authorize the access to a page. but it depends on the value passed to the controller. So the authorization depends on the groupID. Is this possible to achieve this in any way?.
Thanks in advance.
© Stack Overflow or respective owner