2

As a follow up to ASP.NET Webforms Doesn't Render Postback JavaScript Function for Chrome/iOS, we're continuing to have clients (mostly mobile on iOS and Android) reporting this same issue and while it's a relatively simple fix, there doesn't seem to be any fix-all.

For the scope of our application, we consider it safe to render the page assuming an HTML, JavaScript and CSS-capable client.

Is there any way we can disable this feature? Can we change the default browser capabilities without having to go modify the .browser files on each of the web farm nodes? ...Or some other workaround?

Community
  • 1
  • 1
lukiffer
  • 11,025
  • 8
  • 46
  • 70

1 Answers1

2

I don't have time to do a proof of concept, but if you can modify the user-agent header early enough in the request cycle, then ASP.NET should render for that agent.

The down side of this is that the Request headers are readonly, so you have to use reflection to subvert the readonly collection.

Here is an example of how to change headers in a request. HttpModule to add headers to request

I know from experience that this doesn't work for all .net frameworks-- the code necessary changed from 1.1 to 2.0 and again for subsequent frameworks since the trick calls for calling non-public internals.

Community
  • 1
  • 1
MatthewMartin
  • 32,326
  • 33
  • 105
  • 164