Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Mobile Phone Browse Escape Ampersand (&) for URL Developed in ASP.NET MVC?

This is a strange one that I cannot see to figure out. I have a basic mobile site that is coded in ASP.NET MVC (really shouldn't matter in this case but just to put it out there)

When I browse to the specific page, I receive the following error.

This page contains the following errors:

error on line 56 at column 43: EntityRef: expecting ';'

Below is a rendering of the page up to the first error

Now the line specifically is rendering a basic anchor tag does have an ampersand in the query string (should be pretty standard right?). Why might this be an issue?

The IPhone does not have any problem rendering it, nor do regular browsers (IE8, Chrome, FF, etc). By my the Palm Pre Browser, Android, and BlackBerry Bold all display it.

Specifically, below appears to be the offending line (part of a basic paging control):

    <a href="/Mobile/LotBrowse?page=2&watchList=False" style="text-decoration: none" title="go to page 2"> 
    <span class="page-numbers"> 
        2</span></a>
like image 969
aherrick Avatar asked Dec 15 '25 20:12

aherrick


1 Answers

You need to use &amp; for all & in your XHTML code. Any where and every where it is used http://www.w3.org/TR/xml-entity-names/ http://www.digitalmediaminute.com/reference/entity/index.php

like image 125
drubin Avatar answered Dec 19 '25 07:12

drubin



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!