Android Link Error Web page not available asp .net

2019-07-26 22:30发布

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条回答
地球回转人心会变
2楼-- · 2019-07-26 22:54

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.

查看更多
登录 后发表回答