页面传递参数

页面传递参数_第1张图片
image.png

如图所示:
查询

页面传递参数_第2张图片
image.png

查询类型,点击查询按钮后
function sear() {
var sear = "";
if ($("#sonType_Id").val() != "") {
sear += "sonType_Id=" + $("#sonType_Id").val();
}
window.location.href = "news.aspx?"+sear;
}
后台获取参数
protected void Page_Load(object sender, EventArgs e)
{
if (Request.QueryString["sonType_Id"] != null)
{
sonType_Id = Request.QueryString["sonType_Id"];
url += "&sonType_Id=" + sonType_Id;
}

        if (!IsPostBack) 
        {
            Data();
        }
    }
页面传递参数_第3张图片
image.png

查询后的效果

你可能感兴趣的:(页面传递参数)