通过与ASP.NET查询字符串发送数据 [英] Send data through the QueryString with ASP.NET

查看:114
本文介绍了通过与ASP.NET查询字符串发送数据的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我要发送一个字符串使用查询字符串名为Reply.aspx另一页。

I want to send a string to another page named Reply.aspx using the QueryString.

我写的第一页上的code必须发送文本Reply.aspx:

I wrote this code on first page that must send the text to Reply.aspx:

protected void FReplybtn_Click(object sender, EventArgs e)
{
    String s = "Reply.aspx?";
    s += "Subject=" + FSubjectlbl.Text.ToString();
    Response.Redirect(s);
}

我写这篇code中的Reply.aspx页面上:

I wrote this code on the Reply.aspx page:

RSubjectlbl.Text += Request.QueryString["Subject"];

但这种方法不能正常工作,并且不显示文本。

But this approach isn't working correctly and doesn't show the text.

我应该怎么做才能解决这个问题?

What should I do to solve this?

感谢

推荐答案

这是简单的:

第一页:

string s = "~/ADMIN/Reply.aspx?";
s += "Subject=" + FSubjectlbl.Text;
Response.Redirect(s);

第二页:

RSubjectlbl.Text = Request.QueryString["Subject"];

这篇关于通过与ASP.NET查询字符串发送数据的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆