Search code examples
asp.netblackberry-simulator

Blackberry Browser Issue.... Error encountered during XML parse: expecting a name


I am creating a Mobile website using Asp.net and i am facing a XML related issue in BB Browser I am using a Repeater control on my form and the data which is binding the repeater control contains ampersand "&" and it leads to an issue on BlackBerry Browser.... Below is the issue of the image.

After searching on the issue i figure out "ampersand" is the issue so how to handle "&" in data. The Repeater contains Vendor name which is " A & B " so it leads to crash

enter image description here


Solution

  • I solved using Server.HtmlEncode because it contains special characters in my VendorName... Below is the code...

     <asp:Label ID="LabelDescription" runat="server"
                   Text='<%# System.Web.HttpUtility.HtmlEncode(Eval("Description")) %>' />
    

    Thanks again...