Knowledge Management Banner

Knowledge Management Banner

Authentication , Cache profile , Razor , Data Annotation : Part 4

Authentication in MVC

Forms Authentication
  • This is traditional forms based authentication, user can register and login by the credentials used during registration.
  • Details are stored in database, password is hashed not in readable format.
  • This option is typically preferred for internet site

Windows Authentication
  • Application with windows authentication is generally preferreed in intranet
  • A user logs in the windows and launches the application in browser, The Asp.Net will automatically pick up user's identity

Cache Profile
  • We can create cache profile in web.config and assign it to any action by [OutputCache] attribute
  •  [OutputCache(CacheProfile="Cache10Min")]  
     public string GetName()  
     {  
       //Your Code  
     }  
    

Razor in MVC
  • Razor is a markup syntax that tells you embed server based code into web pages

Data Annotation
  • It is used to provide additional information to property of class.
  • Some of the data annotation are
    • Required
    • MinLength
    • MaxLength
    • StringLength

No comments

Powered by Blogger.