Android Link Error Web page not available asp .net

£可爱£侵袭症+ 提交于 2019-12-24 11:20:18

问题


My app is an asp .net vb app. The link appears to work in any browser...except Android.

Here is the dynamic link: http://rentonlive.com/TandL.aspx?xid=106&xtitle=RED%LIGHT%CAMERAS%READER%SURVEY

What is Android looking for? If this is a basic question that I could have figured out elsewhere please guide me after you help me with this issue.

Thank you!


回答1:


I've tried this in the Dolphin browser on Android and that link opens fine. I see a survey relating to red lights. This may therefore be an issue with the specific Android device you tested on, but I think both the cause and the fix are under your control.

Certainly one big problem here is the URL format. Your URL query string parameter xtitle is set to a string that contains % characters. The % character has a special meaning in URLs, it means the following two characters form a HEX character code. So for example if you had xtitle=cat%20and%20dog that sets the xtitle string to "cat and dog" because %20 is the hex encoding for a space character (ASCII character 20).

Your URL is invalid and does not conform the the RFC definition, so it is not reasonable to expect it to work across all browser. I am surprised it works at all in any browser as it completely is wrong - you cannot put any string into a URL parameter, it must be processed first.

You need to properly encode your query string parameters before you add them to the URL string. There is a method in ASP.NET to URL encode a string before you add it to a parameter. http://msdn.microsoft.com/en-us/library/zttxte6w.aspx

For more information about the URL standard look here: http://en.wikipedia.org/wiki/Query_string http://en.wikipedia.org/wiki/Uniform_Resource_Locator

Please rate all answers to questions you post on here, and select the answer you like best with the tick.



来源:https://stackoverflow.com/questions/4927158/android-link-error-web-page-not-available-asp-net

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!