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

UrlPathEncode() public method

public UrlPathEncode ( string s ) : string
s string
return string
		public string UrlPathEncode (string s)
		{
			if (s == null)
				return null;

			int idx = s.IndexOf ('?');
			string s2 = null;
			if (idx != -1) {
				s2 = s.Substring (0, idx);
				s2 = HttpUtility.UrlEncode (s2) + s.Substring (idx);
			} else {
				s2 = HttpUtility.UrlEncode (s);
			}

			return s2;
		}

Usage Example

Example #1
0
 public override string UrlPathEncode(string s)
 {
     return(w.UrlPathEncode(s));
 }
All Usage Examples Of System.Web.HttpServerUtility::UrlPathEncode