ASP.Net - 请求对象 [英] ASP.Net - Request Object

查看:49
本文介绍了ASP.Net - 请求对象的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在一个地方的代码中,Request对象已被用作数组。



请求[任何字符串]



实际代码行是:

Session.Add(astring,Request [any string]);



所以我无法理解Request对象在这里是如何工作的。可以让我知道吗?

In a code at one place, Request object has been used as an array.

Request["any string"]

actual line of code is:
Session.Add("astring", Request["any string"]);

So I am not able to understand how Request object is working here. Can any let me know?

推荐答案

首先,如果你无法理解代码在这里是如何工作的,那么它没有任何意义。很好,请点击以下链接,尝试了解最新情况。

ASP请求对象 [ ^ ]



上面的代码可以写成

First of all,if you are not able to understand how the code is working here,then it doesnt make any sense.Well,follow the link below and try to figure out whats going on.
ASP Request Object[^]

The above code can be written as
Session["astring"]=Request.QueryString["any string"];


关注 - 如何获取参数在网址中(通过C#表示.net) [ ^ ]。

Follow - How to get parameter in url ( by C# for .net) [^].
引用:

实际上在C#中它将是:



Actually in C# it would be:

//this takes request parameters only from the query string
Request.QueryString["parameter1"];










//this one works for bot - form and query string
Request["parameter1"];


这篇关于ASP.Net - 请求对象的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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