0

I get this error when i have this in my codebehind: if(Page.User.Identity.IsAuthenticated)

  System.NullReferenceException: Object reference not set to an instance of an object.

This error show when i use context.RewritePath method http://localhost/page.apsx?id=22 --> http://localhost/hello-world/

Page.User.Identity.IsAuthenticated return True when i go to page.aspx?id=22 but i get

  System.NullReferenceException: Object reference not set to an instance of an object.

error when i go to /hello-world/ url.

  • Would it be possible to post a little bit of code and maybe the full exception details? It would help diagnosing the issue. Thanks. – Joepro Sep 27 '09 at 23:17
  • When i try to debbug the code i can view any info and get the error right away. Any my url rewriting is like this: –  Sep 28 '09 at 07:59

1 Answers1

0

If the url.Contains("List") then rewrite the url like this:

context.RewritePath(Utility.WebRoot + "List/Add.aspx", false);

My rewriter is not more complicate then that.