ashwinkpes
ashwinkpes

Reputation: 13

Appsetting entry in web.config throwing error for special characters

I have to use the below URL in my appsettings in web.config file.

<add key="ReportUrl" value="http://Myserver/ReportServer/Pages/ReportViewer.aspx?/MyApplication/Reports/Safeguards+Equipment+and+Supplies+Request&rs:Command=Render&rc:Parameters=True&RequestNumber="/>

The problem occurs because of the colon used in the value of the appsettings. How can I fix the error.

Error shown is as below

"Application Configuration file "Web.config" is invalid. An error occurred while parsing EntityName...."

Upvotes: 1

Views: 3233

Answers (1)

kudlatiger
kudlatiger

Reputation: 3278

You can try using &amp instead of &;

Below are few XML escape characters for your future use!

"   &quot;
&   &amp;
'   &apos;
<   &lt;
>   &gt;

Read more here What characters do I need to escape in XML documents?

Upvotes: 3

Related Questions