如何在c#中的asp.net中隐藏查询字符串 [英] how to hide query string in url in asp.net in c#

查看:165
本文介绍了如何在c#中的asp.net中隐藏查询字符串的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在asp.net页面中创建的链接很少。当我点击任何链接时,它会将我重定向到另一个页面,示例网址如下: -

http:// localhost:54785 / Mobile%20Browser / GetFieldForCreatingNewWorkflow.aspx?Name = CloseMeterConnection [ ^ ]。



我正在使用QueryString这里传递点击链接的名称。

我想知道如何隐藏URL上的Querystring部分,即?Name = CloseMeterConnection。



这部分并希望将我的网址显示为 http:// localhost:54785 / Mobile%20Browser / GetFieldForCreatingNewWorkflow.aspx [ ^ ]。

因为我是asp.net的新手。我知道的不多。请为我提供代码。在此先感谢。

解决方案

嗨读这个



get和Post方法之间的逐一比较



GET方法:



1.所有名称值对都作为URL中的查询字符串提交。

它不安全,因为它在网络浏览器的位置栏中以纯文本格式显示。



2.字符串的长度受到限制。





3.如果使用get方法,如果刷新页面,则在再次提交请求之前不会提示。



4.One可以将名称值对存储为书签,并在与他人共享时直接使用 - 示例搜索结果。





POST方法:



1.所有名称值对在请求的消息正文中提交。



2.字符串的长度(提交的数据量)不受限制。



3. Post Method是安全的,因为在Web浏览器的位置栏中看不到Name-Value对。



4.如果使用post方法,并且刷新页面,则会在重新提交请求之前提示。



5.如果与表单处理相关的服务有副作用(例如,修改数据库或订阅服务),该方法应该是POST。



6.数据以form标签的enctype属性中指定的形式提交,因此文件可以在FileUpload输入框中使用。



欲了解更多,请参阅此链接



http://wiki.answers.com/Q/

What_is_the_difference_between_get_and_post_method_in_HTTP
[ ^ ]



更多网址将为您提供帮助:



http://www.plus2net.com/asp-tutorial/form -diff.php [ ^ ]



http:// www .cs.tut.fi /~jkorpela / forms / methods.html [ ^ ]



问候

sarva

你需要 URL重写



在这里阅读:

URL用ASP.NET重写 [ ^ ]

MSDN:URL重写 [ ^ ]

I have few links created in a asp.net page. When i click any link it redirects me to another page and sample url is below:-
http://localhost:54785/Mobile%20Browser/GetFieldForCreatingNewWorkflow.aspx?Name=CloseMeterConnection[^].

I am using QueryString Here to pass the name of the link clicked.
I want to know how to hide the Querystring part on the URL i.e. "?Name=CloseMeterConnection.

" this part and want to show my url as http://localhost:54785/Mobile%20Browser/GetFieldForCreatingNewWorkflow.aspx[^].
Since i am new to asp.net. I dont have knowledge that much. Kindly provide me the code for it. Thanks in advance.

解决方案

hi read this

One by one comparison between get and Post Method

GET Method:

1.All the name value pairs are submitted as a query string in URL.
It's not secured as it is visible in plain text format in the Location bar of the web browser.

2.Length of the string is restricted.


3.If get method is used and if the page is refreshed it would not prompt before the request is submitted again.

4.One can store the name value pairs as bookmark and directly be used while sharing with others - example search results.


POST Method:

1. All the name value pairs are submitted in the Message Body of the request.

2. Length of the string (amount of data submitted) is not restricted.

3. Post Method is secured because Name-Value pairs cannot be seen in location bar of the web browser.

4. If post method is used and if the page is refreshed it would prompt before the request is resubmitted.

5. If the service associated with the processing of a form has side effects (for example, modification of a database or subscription to a service), the method should be POST.

6. Data is submitted in the form as specified in enctype attribute of form tag and thus files can be used in FileUpload input box.

For more refer this link

http://wiki.answers.com/Q/
What_is_the_difference_between_get_and_post_method_in_HTTP
[^]

Some more URL will help you:

http://www.plus2net.com/asp-tutorial/form-diff.php[^]

http://www.cs.tut.fi/~jkorpela/forms/methods.html[^]

regards
sarva


You need URL Rewriting.

Read here:
URL Rewriting with ASP.NET[^]
MSDN: URL Rewriting[^]


这篇关于如何在c#中的asp.net中隐藏查询字符串的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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