C# response.redirect传递多参
来源:互联网 发布:淘宝书店赚钱吗 编辑:程序博客网 时间:2024/05/23 12:06
还是老规矩,简单的就直接上代码,直观。
下面这行代码是1.aspx文件的button事件:本页面有几个文本框,是一些查询条件啦,button1是搜索按钮啦。因为我要把查出来的东西放到2.aspx的datagrid里面显示出来,所以干脆直接把参数传过去,在那边查,那边显示咯。
protected void Button1_Click(object sender, EventArgs e)
{
Response.Redirect("Company.aspx?Companyname=" + Companyname.Text + " &&Companycode=" + Companycode.Text + " &&Companyperson=" + Companyperson.Text + " &&Tel=" + Tel.Text + " &&Mail=" + Mail.Text);
}
下面讲诉2.aspx如何调用:
protected void Page_Load(object sender, EventArgs e)
{
int isnull = -1;
string Companyname = Request.Params["Companyname"];
string Companycode = Request.Params["Companycode"];
string Companyperson = Request.Params["Companyperson"];
string Tel = Request.Params["Tel"];
string Mail = Request.Params["Mail"];
if (Companyname==null && Companycode==null && Companyperson==null && Tel==null && Mail==null)
isnull = 0;
if (isnull != 0)
{
BindOneCompany(Companyname, Companycode, Companyperson,Tel,Mail);
}
else
{
BindCompany();
}
}
给各位解惑了吗?怎么说呢,不知道这个方法是不是笨拙了点,不过我自学自编,能够出结果,感觉是灰常开心啦。。。
- C# response.redirect传递多参
- Response.Redirect 传递多个属性值
- Response.Redirect传递参数
- Response.Redirect传递参数
- Response.Redirect 跳转传参 传递包含“&”的参数
- 如何使用Response.Redirect 方法传递汉字
- 如何用Response.Redirect传递汉字
- 使用Response.Redirect方法传递汉字
- 如何用Response.Redirect方法传递汉字
- 如何用Response.Redirect传递汉字
- Struts2 redirect传递多参数
- C#调用Response.Redirect方法触发异常问题
- C#调用Response.Redirect方法触发异常问题
- C#调用Response.Redirect方法触发异常问题
- C#调用Response.Redirect方法触发异常问题
- Response.Redirect的问题
- Response.Redirect 打开新窗口
- Response.Redirect 异常
- 管理必须知道
- phpunit+selenium环境搭建
- virtualbox下安装windows xp
- CIO关注:IT外包前的种种准备
- 两分钟彻底让你明白Android Activity生命周期(图文)!
- C# response.redirect传递多参
- flash跨域策略文件crossdomain.xml配置详解
- 为JAXB书写工具类
- 我的Linux系统学习秘籍(新)
- Eclipse进行javadoc的导出时,提示“编码 GBK 的不可映射字符”
- Hadoop 2.0 NameNode HA和Federation实践
- socket在windows下和linux下的区别
- 中断服务下半部之工作队列【转】
- MFC中使用定时器