asp.net中的url中没有参数 [英] no parameters in url in asp.net

查看:66
本文介绍了asp.net中的url中没有参数的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述




我重定向到确认页面并希望显示上一页的一些值,但是如果我在url中显示带参数的确认页面(最后一页)可以吗?



或如何从上一页获得价值,在确认页面中,在网址中没有参数...



我想你明白了???



问候



maulik shah

Hi
i redirect to confirmation page and want to show some values from previous page , but is it ok if i show confirmation page with parameters in url (last page) ???

or how to get value from previous page , in confirm page , without parameters in url...

I think you understood ???

regards

maulik shah

推荐答案

从一个aspx传递数据/参数/值页面到另一个aspx页面 [ ^ ]

将值从一个页面传递到另一个页面 - ASP.NET [ ^ ]


雅没关系,

没错。除非它是机密信息。



无论如何你在屏幕上显示值,然后用户看到URL上的值没有问题。



如果您认为这是一个严重的问题,您可以使用 sessions 来读取/写入值(将被隔离来自URL:clean url)
Ya it is fine,
nothing wrong in it. unless it is a confidential information.

anyhow you are displaying the values on the screen, then no issues on the user seeing the values on the URL.

if you are thinking it as a serious issue, you can use sessions to Read/Write the values ( which will be isolated from the URL ie: clean url )


如果您不想在URL中传递参数,那么您可以使用会话变量。

添加此项在您的页面中:

If you don't want to pass th parameters in the URL, then you can use session variables.
Add this in your page:
Session["ConfirmationValue1"] = "value1";
Session["ConfirmationValue2"] = "value2";
// add other values if you need



重定向后,您可以得到如下值:


And after redirecting, you can get the values like this:

string value1 = (string)Session["ConfirmationValue1"];
string value2 = (string)Session["ConfirmationValue2"];



有关会话变量的更多信息:在ASP.NET中探索会话 [ ^ ]



如果你不喜欢我不想使用 Session 变量,然后你可以用POST重定向和提交数据:

ASP.NET中的重定向和POST [ ^ ]


More about session variables: Exploring Session in ASP.NET[^]

If you don't want to use Session variables, then you can redirect and submit data with POST:
Redirect and POST in ASP.NET[^]


这篇关于asp.net中的url中没有参数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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