asp.net简化接收参数值的函数
时间:2021-07-01 10:21:17
帮助过:10人阅读
/// <summary>
/// 获取querystring
/// </summary>
/// <param name="s">参数名</param>
/// <returns>返回值</returns>
public string q(string s)
{
if (Request.QueryString[s] != null)
{
return Request.QueryString[s].ToString();
}
return string.Empty;
}
/// <summary>
/// 获取post得到的参数
/// </summary>
/// <param name="s">参数名</param>
/// <returns>返回值</returns>
protected string f(string s)
{
if (Request.Form[s] == null) return string.Empty;
return Request.Form[s];
}