页面传递参数

image.png

如图所示:
查询

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();
        }
    }
image.png

查询后的效果

<script>$('#sonType_Id').find('option[value="+sonType_Id+"]').attr('selected',true);

最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容