从QueryString读取和写入 [英] Read And Write From QueryString

查看:91
本文介绍了从QueryString读取和写入的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Response.Redirect(〜/Form1.aspx?SrNo =" + e.CommandArgument.ToString()+");
HiddenField1.Value =(string)Request.QueryString ["SrNo"];

Response.Redirect("~/Form1.aspx?SrNo=" + e.CommandArgument.ToString() + "");
HiddenField1.Value = (string)Request.QueryString["SrNo"];

推荐答案

是的,在某种意义上读写查询字符串是可以的.

您可以使用?"和&"
在URL中附加查询字符串 您可以使用Request.Querystring集合返回查询字符串.
Yes, in a sense reading and writing the quesry string is fine.

You attach query string in the URL using ''?'' & ''&''
You get back query string using Request.Querystring collection.


没有问题,并从标题中删除了((它是对的))".我们无法告诉您您的代码是否正确",因为我们没有(也不想要)您的所有代码.如果可以编译,请在调试器下运行它.如果不正确,您很快就会知道.
Not a question, and removed "(Is it right)" from title. We can''t tell you if your code is "right", because we don''t have (nor do we want) all of your code. If it compiles, run it under the debugger. If it''s not right, you''ll know in short order.


这篇关于从QueryString读取和写入的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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