System.Web.HttpServerUtility.UrlEncode C# (CSharp) Method

UrlEncode() public method

public UrlEncode ( string s, TextWriter output ) : void
s string
output System.IO.TextWriter
return void
		public void UrlEncode (string s, TextWriter output)
		{
			if (s != null)
				output.Write (UrlEncode (s));
		}

Same methods

HttpServerUtility::UrlEncode ( string s ) : string

Usage Example

 public static void OutputExcel(System.Web.HttpServerUtility server, System.Web.HttpResponse response, string filename, MemoryStream ms)
 {
     byte[] bytes = ms.GetBuffer();
     response.Charset         = "UTF8";
     response.ContentEncoding = Encoding.UTF8;
     response.AddHeader("Content-Disposition",
                        "attachment; filename=" + server.UrlEncode(filename + ".xls"));
     response.ContentType = "application/vnd.ms-excel";
     response.BinaryWrite(bytes);
     response.End();
 }
All Usage Examples Of System.Web.HttpServerUtility::UrlEncode