如何检查QueryString的引用 [英] How to Check the references of a QueryString

查看:122
本文介绍了如何检查QueryString的引用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有两个webforms并使用Querysting将webform-1的值传递给webform-2。现在在webform-2中,我通过使用webform-1中的Request.Querystring读取webform-1值来重用这些值。如果项目包含50个webforms,那么如何知道查询字符串正在引用的位置......以及它引用的是哪个..

Im having two webforms and im using Querysting to pass the values of webform-1 to the webform-2. Now in webform-2 i reuse the values by reading webform-1 values using Request.Querystring from webform-1. Incase if the project is containing 50 webforms then how to know from where exactly the query string is refering to.. and to Which is it's refering to..

推荐答案

无论你做什么都听起来像个坏主意。您可能想重新考虑自己在做什么。例如,当移动到另一个表单时,将信息保存在数据库中,然后在查询字符串中传递一个id。



但是,如果你确实需要知道你来自哪个页面可以使用Request.ServerVariables [HTTP_REFERER]或Request.UrlReferrer。或者你总是可以在查询字符串中添加另一个参数来表示你需要的东西。
First off, whatever you are doing sounds like a bad idea. You may want to rethink what you are doing. For example, when moving to another form, save the information in the database and then pass a single id through in the query string.

However, if you do need to know which page you are coming from you can use Request.ServerVariables["HTTP_REFERER"] or Request.UrlReferrer. Or you could always put another parameter in the querystring to indicate what you need.


你在Querystring上传递参数,那时你也必须提到webform。那么为什么你担心其他形式,你指向特定的网络形式,而重定向时间,然后你有什么疑问?
You are passing parameters over Querystring at that time you have to mentioned the webform also. Then why do you worry about other forms, your pointing the particular webform while redirect time then what's your doubt in that?


这篇关于如何检查QueryString的引用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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