[AttributeUsage(AttributeTargets.Class |
AttributeTargets.Method, AllowMultiple = false, Inherited = true)]
public sealed class AllowAnonymousAttribute : Attribute
{
}
Tuesday, January 28, 2014
How to create AllowAnonymous Attribute in ASP.NET MVC 3?
There is one in ASP.NET MVC 4, but not in MVC 3.
Monday, January 27, 2014
Tuesday, January 21, 2014
Monday, January 20, 2014
How to set UserName property value in customized MembershipUser class?
Because in base class UserName property is read only.
public virtual string UserName { get; }
So need to call base constructor to set the value
public virtual string UserName { get; }
So need to call base constructor to set the value
public class CustomerUser : MembershipUser
{
public string CID { get; set; }
public CustomerUser(string username, string cid:
base("CustomerMembershipProvider",
username,
null,
null,
null,
null,
true,
false,
System.DateTime.Now,
System.DateTime.Now,
System.DateTime.Now,
System.DateTime.Now,
System.DateTime.Now)
{
CID= cid;
}
}
Subscribe to:
Posts (Atom)