Author: mandrews1234 | Posted on: 10/2/2009 10:41:16 AM | Views : 268

I have a web project I have been working on for sometime and it was running fine. Now whenever I try to go to a page on my admin side I get an error saying object was null and it pointing to the line
if(roles.isuserinrole(Membership.GetUser.UserName, "role"))
Now this code has worked fine up until now. I noticed that when I go to the non administrative side, my login view is showing the logged in side instead of the annonymous side. I restarted my machine thinking that would fix the problem but that was a no go. I'm guessing the error is coming from the fact that it thinks I'm logged in but I'm not so it doesn't have a username so it's null. If I compile this code and run it on an actual server it runs fine. Does anyone have an idea how I can fix the local server error problem? Note: by local server I mean my actual machine, and I do have IIS 7 running on my machine whereas our server is still IIS 6. Thanks,

...

Go to the complete details ...