Friday, March 16, 2012

Login page fails in precompiled web site

I have a plain vanilla login page on my Web site that works fine if Ideploy it uncompiled, that is, with both the .aspx and the code-behindfiles. But if I try to deploy it precompiled, the login pagefails. The page seems to post, but then is just redisplayed withthe login/password fields blank, and the cookie isn't set. Noerror or anything.
The rest of the Web site seems to work fine, the only problem is thelogin. The login page is just completely standard, there areseveral subdirectories that are protected with web.config's, andafter you login, you are redirected to one of the subdirectoriesdepending on your login.
Where do I start with this? This is the first time I've used aspnet_compile so I'm sort of thrashing around.
It actually turns out the cookie *is* created. What happens isthat the login page tries to redirect to the protected directory, forsome reason the cookie isn't recognized and it redirects right back tothe login page. Again, this only happens when the web site isprecompiled. I am assigning roles in the global.asax, could ithave something to do with this?

Hello.

very strange indeed...tell me something: have you tried to deply it in your machine? try to precompile the site and then create the new virtual app in IIS. does the error still occur? btw, are you using windows or forms authentication?


I am having a similar problem with forms authentication. I have generic login page which, after creating the cookie, redirects back to the index page. The scenario works perfectly without precompiling but fails with this error on a precompiled site:

[NullReferenceException: Object reference not set to an instance of an object.] System.Web.Script.Services.WebServiceData.GetWebServiceData(HttpContext context, String virtualPath, Boolean failIfNoData, Boolean pageMethods) +379 System.Web.Script.Services.PageClientProxyGenerator.GetClientProxyScript(HttpContext context, IPage page, Boolean debug) +45 System.Web.UI.ScriptManager.RegisterServices() +728 System.Web.UI.ScriptManager.OnPagePreRenderComplete(Object sender, EventArgs e) +244 System.Web.UI.Page.OnPreRenderComplete(EventArgs e) +2012740 System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1566

0 comments:

Post a Comment