HtmlTextWriter.WriteEncodedUrl Method
.NET Framework 3.0
Encodes the specified URL, and then writes it to the output stream. The URL might include parameters.
Namespace: System.Web.UI
Assembly: System.Web (in system.web.dll)
Assembly: System.Web (in system.web.dll)
The following code example shows how to use the WriteEncodedUrl method, which generates the following output:
http://localhost/Sample%20Folder/Sample%20%2b%20File.txt
// Assign a value to a string variable // and URL-encode it to a page. url = "http://localhost/SampleFolder/Sample + File.txt"; writer.WriteBreak(); writer.WriteEncodedUrl(url); writer.WriteBreak();
Community Additions
ADD
Show: