<asp:TemplateField> <ItemTemplate> <%# Container.DataItemIndex + 1 %> </ItemTemplate> </asp:TemplateField>
  Here's how I do it.   I decided to use IPrincipal instead of IIdentity because it means I don't have to implement both IIdentity and IPrincipal.    Create the interface  interface  ICustomPrincipal  :  IPrincipal  {      int  UserId  {  get ;  set ;  }      string  FirstName  {  get ;  set ;  }      string  LastName  {  get ;  set ;  }  }    CustomPrincipal  public  class  CustomPrincipal  :  ICustomPrincipal  {      public  IIdentity  Identity  {  get ;  private  set ;  }      public  bool  IsInRole ( string  role )  {  return  false ;  }       public  CustomPrincipal ( string  email )      {          this . Identity  =  new  GenericIdentity ( email );      }       public  int  UserId  {  get ;  set ;  }      public  string  FirstName  {  get ;  set ;  }      public  string  LastName  {  get ;  set ;  }  }    CustomPrincipalSerializeModel - for serializing custom information into userdata field in FormsAuthenticationTicket object.  public  class  CustomPrincipalSerializeMode...
Comments
Post a Comment