zoukankan      html  css  js  c++  java
  • Asp.net--两个页面传参--QueryString

    参数值页面:

      protected void btsmupdate_Click(object sender, EventArgs e)
        {
    DB db
    = new DB(); string str = "select sid,sname,sex,age,province,education,graduation from staffInfo where sid='" + strsid + "'"; SqlDataReader dr = db.reDr(str); dr.Read(); if (dr.HasRows) { string strsname = dr.GetValue(1).ToString().Trim(); string strsex = dr.GetValue(2).ToString().Trim(); string strage = dr.GetValue(3).ToString().Trim(); string strprovince = dr.GetValue(4).ToString().Trim(); string streducation = dr.GetValue(5).ToString().Trim(); string strgraduation = dr.GetValue(6).ToString().Trim(); Response.Redirect("~/StaffAdd.aspx?sid=" + strsid + "&sname=" + strsname + "&sex=" + strsex + "&age=" + strage + "&province=" + strprovince + "&education=" + streducation + "&graduation=" + strgraduation + ""); } }

    获取页面:

                    tbsmid.Text = Request.QueryString["sid"].Trim();
                    tbsmname.Text = Request.QueryString["sname"].Trim();
                    ddlsmsex.SelectedValue = Request.QueryString["sex"].Trim();
                    tbsmage.Text = Request.QueryString["age"].Trim();
                    ddlsmprovince.SelectedValue = Request.QueryString["province"].Trim();
                    ddlsmeducation.SelectedValue = Request.QueryString["education"].Trim();
                    tbsmgraduation.Text = Request.QueryString["graduation"].Trim();
  • 相关阅读:
    模板【洛谷P3368】 【模板】树状数组 2
    模板【洛谷P3812】 【模板】线性基
    Java面向对象-多态
    Java常用工具类
    Java常用工具类
    Java static关键字
    MyBatis对象关联查询demo (一对多,多对一)
    将Cmder添加到系统右键菜单中
    IDEA 创建JavaWeb应用打包并发布
    IDEA 调试与打包
  • 原文地址:https://www.cnblogs.com/Deerjiadelu/p/7252953.html
Copyright © 2011-2022 走看看