asp.net简化接收参数值的函数
作者:
获取querystring 参数名
/// <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];
}
/// 获取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];
}