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

UrlDecode() public method

public UrlDecode ( string s ) : string
s string
return string
		public string UrlDecode (string s)
		{
			HttpRequest request = context.Request;
			if(request != null)
				return HttpUtility.UrlDecode (s, request.ContentEncoding);
			else
				return HttpUtility.UrlDecode (s);
		}

Same methods

HttpServerUtility::UrlDecode ( string s, TextWriter output ) : void

Usage Example

Example #1
0
    public void Check_IsBlank()
    {
        string content = tools.CheckStr(Request["val"]);
        string success = tools.CheckStr(Server.UrlDecode(Request["success"]));

        if (success == "")
        {
            success = "信息输入正确!";
        }
        string error = tools.CheckStr(Server.UrlDecode(Request["error"]));

        if (error == "")
        {
            error = "信息不可为空!";
        }
        if (content == "")
        {
            Response.Write("<font color=\"#cc0000\">" + error + "</font>");
            return;
        }
        else
        {
            Response.Write("<font color=\"#00a226\">" + success + "</font>");
            return;
        }
    }
All Usage Examples Of System.Web.HttpServerUtility::UrlDecode