title: Using Action Filters on MVC C# using query String
body: <p>Im using class name RightCheckerAttribute to check user permission in MVC3 application...
  So the RightCheckerAttribute class is like this...</p>
  
  <pre><code>    public bool isAdmin { get; set; }
  
      public override void OnActionExecuting(ActionExecutingContext filterContext)
      {
          HttpContextBase context = filterContext.HttpContext;
  
          bool result = Convert.ToBoolean(context.Request.QueryString["isAdmin"].ToString());
  
          if (isAdmin != result) 
          {
              RouteValueDictionary redirecttargetDictionary = new RouteValueDictionary();
              redirecttargetDictionary.Add("action", "NoPermission");
              redirecttargetDictionary.Add("controller","Singer");
              filterContext.Result = new RedirectToRouteResult(redirecttargetDictionary);
  
          }
  
          //base.OnActionExecuting(filterContext);
      }
  </code></pre>
  
  <p>So in Method i applying this have head as..</p>
  
  <p><code>[RightChecker (isAdmin=true)]</code></p>
  
  <p>Im Executing this method as this..</p>
  
  <p><code>http://localhost:5576/Singer/DeleteSinger?isAdmin=true</code></p>
  
  <p>The problem is whether I'm passing true or false... I got result variable as false... And I'm getting:</p>
  
  <blockquote>
    <p>Exception[Null Object references]...</p>
  </blockquote>