• Sub-Template

            <p>
            To register a sub-template, you include a register directive in the master template. You can include as many Register directives as you like, so one master template can include multiple sub-templates. Sub-templates can be nested.
            </p>
    
  • xsd maxOccurs="2" minOccurs="1"

    XSD allow you to specified maxOccurs=”2” minOccurs=”1” in sequence and and element. What is the difference. Below is section

  • Debugging Form Authentication API in asp.net

      FormsAuthentication.RedirectFromLoginPage(UsernameText.Text, false);
    
  • Improving the Performance of a Reusable Authorization Framework

            <ul>
            <li>
            Batch authorization queries whenever possible to avoid frequent out-of-process
            round trips. For example, retrieve roles for multiple users in a single request.
            </li><li>
            Cache the authorization data close to where you will use it with an in-memory
            store, such as a Hashtable. The cache also reduces dependencies on the location
            and organization of the underlying store. You might also want a separate cache
            for each physical computer, for performance and increased security.
            </li><li>
            Implement scheduled or on-demand refreshes of the cache information.
            </li><li>
            Implement lazy initialization of the authorization cache to avoid retrieving
            authorization information when no access checks will occur.
            </li>
            </ul>
    
  • How to Change the Principal in an ASP.NET Application

    protected void Application_AuthenticateRequest(Object sender, EventArgs e)
    {
       // Check whether there is a current user and that
       // authentication has occurred.
       if (!(HttpContext.Current.User == null))
       {
          IIdentity CurrentUserIdentity = HttpContext.Current.User.Identity;
          // Check to see whether the Principal was cached.
          string CachedPrincipalKey = "CachedPrincipal" + id.Name;
          if (HttpContext.Current.Cache[CachedPrincipalKey] == null)
          {
                // Load the principal by calling the GetPrincipal method.
                HttpContext.Current.Cache.Add(
                CachedPrincipalKey,
                GetPrincipal(CurrentUserIdentity),
                null,
                DateTime.MaxValue,
                new TimeSpan(0,30,0),
                CacheItemPriority.Normal,
                null);
          }
          HttpContext.Current.User = (IPrincipal)
          HttpContext.Current.Cache[CachedPrincipalKey];
       }
    }