The documentation suggests that Server.UrlEncode
should handle ampersands correctly.
I’ve just tested your exact code and the returned string was correctly encoded:
More Related Contents:
- Easiest way to parse “querystring” formatted data
- How can I remove item from querystring in asp.net using c#?
- Access Query string parameters with no values in ASP.NET
- How to update querystring in C#?
- Encrypt Query String including keys
- Get the correct week number of a given date
- Call a stored procedure with parameter in c#
- Is there a good LINQ way to do a cartesian product?
- How to access session variables from any class in ASP.NET?
- Cannot open database “test” requested by the login. The login failed. Login failed for user ‘xyz\ASPNET’
- Convert webpage to image from ASP.NET
- Dynamically change connection string in Asp.Net Core
- ITextSharp insert text to an existing pdf
- How to merge multiple pdf files (generated in run time)?
- Convert JSON String to JSON Object c#
- Avoiding SQL injection without parameters
- Display custom error page when file upload exceeds allowed size in ASP.NET MVC
- Basic Simple Asp.net + jQuery + JSON example
- ASP.NET GridView: How to edit and delete data records
- ASP.NET Session size limitation
- Update multiple records at once in asp.net mvc
- Different LIKE behaviour between my application and the Access query wizard
- Calling async methods from non-async code
- I’ve been hacked. Evil aspx file uploaded called AspxSpy. They’re still trying. Help me trap them‼
- How to convert DataTable to class Object?
- call async method without await #2
- How to set the value of a textbox textmode=date ASP.NET C#
- Find a control in a webform
- Can gzip compression be selectively disabled in ASP.NET/IIS 7?
- How to get the first five character of a String