51Degrees.mobi

This is the place to report bugs and get support. When posting in this forum, please always provide as much detail as possible.

Please do not report problems with a custom build or custom code in this forum. If you are producing your own build from the source code and have problems or questions, ask in the developer forum, do not report it as a bug.

This is the place to report bugs and get support

When posting in this forum, please try to provide as many relevant details as possible. Particularly the following:

  • What operating system were you running when the bug appeared?
  • What database platform is your site using?
  • What version of mojoPortal are you running?
  • What version of .NET do you use?
  • What steps are necessary to reproduce the issue? Compare expected results vs actual results.
Please do not report problems with a custom build or custom code in this forum. If you are producing your own build from the source code and have problems or questions, ask in the developer forum.
This thread is closed to new posts. You must sign in to post in the forums.
1/4/2012 11:05:10 PM
Gravatar
Total Posts 190

51Degrees.mobi

Hi All,

Is there a possibility that recent updates to mojoPortal could conflict with the mobile redirect at 51degrees.codeplex.com? I've been having weird behavior lately where postback from the homepage with no page name in the URL. Rather than redirecting like it's supposed to, it just posts back and stays on the home page. (This is similar to an issue in a post here from a couple years ago but the problem only occurred in the VS dev server. This doesn't give any error message, though.) I'm having a huge problem with this at the moment as I just updated my production site to version 2.3.7.5 and I can't seem to get to the cause. It's very inconsistent and seems to intermittently affect different browsers at different times. http://www.metrotransit.org/ Any input or suggestions would be greatly appreciated!

Thanks,

John

1/5/2012 6:29:16 AM
Gravatar
Total Posts 18439

Re: 51Degrees.mobi

Hi John,

I don't know anything about 51degrees, but I can say that it is normal for your home page to work with 3 different urls

yoursiteroot/

yoursiteroot/home.aspx (assuming that home.aspx is the defined url for your home page)

yoursitesiteroot/Default.aspx

and postback could occur and should work correctly for any of those 3 possible urls. I don't know why you would expect anything different for the first variation of the url. There is a bug in VS web server where an error can happen in the first variation but there is no bug in IIS, that url is supposed to work for postback.

Just taking a quick look at 51degrees I see it is an httpmodule plugged into web.config. I would think it matters in which order the httpmodules run so the position of the declaration for it would be important. I'm not sure wheether it should be before or after our mojoUrlRewriter module. If it needs to run first then it should be above our module or if it needs to detect the rewritten url then it should be after our module.

Hope that helps,

Joe

1/5/2012 8:46:43 AM
Gravatar
Total Posts 190

Re: 51Degrees.mobi

Hi Joe,

I agree with your first point and I certainly would not expect any different behavior if a page name is specified in the URL or not. That's the problem. The behavior is different. When there is no page specified, the postback doesn't work correctly. It only works when there is something in the URL after metrotransit.org/. I've tried taking the 51degrees module out of the web.config and it doesn't seem to matter. I also removed that redirect code I added for fake folder names (I sent you a copy) to see if that was the problem. You can give our website a try. It's still doing it. Anything you try to do in that accordion thing on the right will fail if the URL just ends with metrotransit.org/. You can type in default.aspx (and hit enter) or just click the logo at the top and it will work then.

At the moment on Windows 7, FF8 and Safari5 aren't working, but IE9 are Chrome16 don't seem to have any problems. On Windows XP last night IE8 wasn't working but FF8 was OK. However, that doesn't remain consistent. Yesterday it was IE9 that wasn't working and FF was fine. It really makes no sense and I have no idea what's going on here, but I'm still digging. Too many unhappy bus riders at the moment! Let me know if anything comes to mind and I'll certainly post again if I find a fix.

Thanks,

John

1/5/2012 9:05:52 AM
Gravatar
Total Posts 18439

Re: 51Degrees.mobi

Hi John,

So now it sounds like it isn't even related to 51degrees since you removed it from the equation and the problem still happens.

Are you sure its related to recent mojoPortal updates? ie did you upgrade recently and it started right away after that?

My guess is it is more likely the result of changes in a recent ASP.NET security update.

Are you seeing any errors in the log?

The ASP.NET security update set a limit on the allowed number of form elements and your home page has a lot of them so it seems likely a factor. I encountered an error on this site after the security update when I went to save site settings. It turned out to be caused by having too many form elements because I had a lot of roles and the permission tab has about 10-12 checbox lists populated by all the roles and combined with all the other form elements on the page it all added up to more than 1000 form elements which is what the new security update set as a limit. I solved it temporarily by removing extra roles that I was not using, and I have since solved it in our source code repository by moving the permissions out of site settings into its own pages such that only one permission is updated at a time so even with a lot of roles it doesn't add up to that many form elements.

There is another workaround you can try as mentioned in the post by Scott Gu linked above, you can add this in your user.config file

<add key="aspnet:MaxHttpCollectionKeys" value="1500"/>

You may want to experiment with that and try higher numbers like 2000 and if that solves it back it down as much as you can without restoring the error.

I don't see why it would be browser specific though if it is caused by the ASP.NET security update changes, but your home page does have a lot of form elements so that would be my first guess.

Hope that helps,

Joe

1/5/2012 9:22:26 AM
Gravatar
Total Posts 190

Re: 51Degrees.mobi

Hi Joe,

I've been seeing this on my test server for a month or two, so it wouldn't have been a security update this recent. But the problem was intermittent and just sort of came and went a couple times. I will sure give this a try, though. But there again, it doesn't happen in all browsers, or even the same browser consistently. And the problem only occurs on the home page when no page name is specified in the URL. "metrotransit.org/default.aspx" works fine, while "metrotransit.org" is broken. Every other page in the site works fine, since of course, there is always something after ".org/". I'll keep digging and post again when I find something.

John

1/5/2012 9:32:02 AM
Gravatar
Total Posts 18439

Re: 51Degrees.mobi

Hi John,

You could try solving it like this:

if(Page.Form.Action.Length == 0) { Page.Form.Action = "/Default.aspx";}

Hope that helps,

Joe

1/9/2012 4:29:19 PM
Gravatar
Total Posts 190

Re: 51Degrees.mobi

Hi Joe,

I tried your previous suggestion without any luck. I put that line in default.aspx at the start of the page_load event handler but that didn't seem to make any difference. I ended up running across http://www.asp.net/whitepapers/aspnet4/breaking-changes#0.1__Toc256770154 (from another friendly benefactor) and after trying a few things with the module entries I tried removing "runAllManagedModulesForAllRequests" from the modules tag and that seemed to fix it. I would appreciate if you have anything enlightening on that particular value as I'm planning to research and read up on that for awhile in the hopes that I haven't simply traded one problem for another. Thanks again and I appreciate your input.

John

1/10/2012 8:22:28 AM
Gravatar
Total Posts 18439

Re: 51Degrees.mobi

Hi John,

The runAllManagedModulesForAllRequests attribute when set to true enables the use of extensionless urls. So, if you are not using extensionless urls you can remove that with no problems. We did change in some recent version to enable that by default since most people are using  IIS 7.x nowadays. In a nutshell what that does is make .NET httpmodules execute for all requests not just for extensions mapped to .NET like .aspx, .ashx etc, but all requests even for static files, the .NET httpmodules will participate in the request. So it makes it possible for our urlrewritermodule to rewrite requests with no extension like /home instead of /home.aspx to /Default.aspx?pageid=x. Otherwise our module would not execute for requests like /home

I did recently notice something in mojoBasePage that may explain why my suggestion about changing the form action from server side code didn't work. We are injecting some javascript that is meant to solve a problem with ajax postbacks right around line # 1383 in mojoBasePage. The javascript is setting the form action to match the url so it may be defeating the server side code that is setting the form action to /Default.aspx.

I've since wrapped a web.config setting around it so it is possible to turn that off. You could try commenting it out in your copy if you are not using the latest code from the repository, or just remove the runAllManagedModulesForAllRequests as you have done.

Best,

Joe

1/10/2012 11:15:20 AM
Gravatar
Total Posts 190

Re: 51Degrees.mobi

Hi Joe,

Yes indeed, I did go back to the last working code I had in production and saw that "runAllManagedModulesForAllRequests" was added to the module tag since then. For some reason, with that setting the posted form data was somehow getting messed up before it could be processed on the postback. So none of the form dropdowns and other stuff was working on the home page without a page w/extension in the URL. I also ran across this article http://www.britishdeveloper.co.uk/2010/06/dont-use-modules-runallmanagedmodulesfo.html that talks about this issue. But since I'm not using extensionless URLs on my site it isn't really an issue to leave it out. So, happily, I think this issue is pretty well put to rest.

Thanks again,

John

1/10/2012 12:26:23 PM
Gravatar
Total Posts 18439

Re: 51Degrees.mobi

Hi John,

Thanks for that! Extensionless urls does seem to work without enabling runAllMangedModulesForAllRequests if I set preCondition="" on the module itself. However I think it is really doing the same thing as runAllManaged modules but doing it on a module by module basis, so setting them all to preCondition="" is probably about equivalent to using runAllMangedModulesForAllRequests="true".

Best,

Joe

You must sign in to post in the forums. This thread is closed to new posts.