request.querystring

What is the type of Request.QueryString() and how to check if it's empty?

隐身守侯 提交于 2019-12-12 00:18:37
问题 Maybe it's trivial question, but I have no idea what is the type of Request.QueryString() . When I check it with typeof - it says it's Object. How to check which object it is and which property of that object is a string in URL? I'm doing it server side with language specification <%@ language="javascript"%> If I've got URL like that: http://127.0.0.1/Kamil/Default.asp?name= then how to check if name is empty? It's not null. I know I can convert Request.QueryString("name") to String and check

How to make a popup in ASP.Net and pass information to it using a query string?

。_饼干妹妹 提交于 2019-12-11 11:43:22
问题 I have all the code I need to response.redirect a page and pass the information I need to the other page. But I don't want it to redirect the page but rather create a popup in the page. I have code for the popup also but I can't manage to pass information to it. This is the code for the popup and it's not passing any information: <asp:LinkButton ID="lb_viewstudenttimetable" runat="server" OnClick="lb_viewstudenttimetable_Click" OnClientClick="window.open('Timetable_User.aspx','Timetable',

Object reference not set to an instance of an object

大城市里の小女人 提交于 2019-12-11 00:28:24
问题 When I try to open the page from my IDE in VS 2008 using "VIEW IN BROWSER" option I get "Object reference not set to an instance of an object" error. The piece of code I get this error : XResult = Request.QueryString["res"]; TextBox1.Text = XResult.ToString(); 回答1: The problem here is that XResult is null and when you call ToString on it the code produces a NullReferenceException . You need to account for this by doing an explicit null check TextBox1.Text = XResult == null ? String.empty :

Using Request.QueryString, slash (/) is added to the last querystring when it exists in the first querystring

蹲街弑〆低调 提交于 2019-12-07 15:07:09
问题 this is my first post on stackoverlow and I couldn't find a solution to this in any other posts, so here it goes: I have a web page that is sending two query strings in the url: example.aspx?name=<%=name%>&sku=<%=sku%> I then collect the values using Request.QueryString["name"]; and Request.QueryString["sku"]; When I view the url on the source of the page sending the query strings everything looks fine, but if "name" contains a forward slash (/) it will somehow get tacked on to the end of

How to properly use a QueryString in .NET ASP C#?

跟風遠走 提交于 2019-12-07 08:00:32
问题 I have a web form in .NET using ASP and C#. This form has a DropDownList control with its AutoPostBack property set to True . Some data on the form is displayed when the user selects an item from the DropDownList . Now, I want the user to be able to share his or her data by just copying the URL which has the QueryString on it like http://www.site.com?ProdID=1234 . I have done the following to try to accomplish this: protected void Page_Load(object sender, EventArgs e) { // check if the URL

Using 'querystring.parse' built-in module's method in Node.JS to read/parse parameters

混江龙づ霸主 提交于 2019-12-06 13:55:50
Scenario : Consider the following code: var querystring = require('querystring'); var ParamsWithValue = querystring.parse(req._url.query); Then I am able to read any query string 's value. E.g: If requested string is http://www.website.com/Service.aspx?UID=Trans001&FacebookID=ae67ea324 I can get the values of query string with codes ParamsWithValue.UID & ParamsWithValue.FacebookID respectively. Issue: I am able to get the values of any number of parameters passed in the same way described above. But for second time onwards I am getting the following error in response on browser. Error : {"code

Using Request.QueryString, slash (/) is added to the last querystring when it exists in the first querystring

纵然是瞬间 提交于 2019-12-05 20:47:27
this is my first post on stackoverlow and I couldn't find a solution to this in any other posts, so here it goes: I have a web page that is sending two query strings in the url: example.aspx?name=<%=name%>&sku=<%=sku%> I then collect the values using Request.QueryString["name"]; and Request.QueryString["sku"]; When I view the url on the source of the page sending the query strings everything looks fine, but if "name" contains a forward slash (/) it will somehow get tacked on to the end of "sku" when I retrieve the value of the query string. I've tried to replace the / with %2F but that doesn't

Difference between Request.Form and Request.QueryString?

坚强是说给别人听的谎言 提交于 2019-12-02 23:21:25
Can some tell me the exact difference between Request.Form and Request.QueryString ? I know one difference, like If the HTTP request method is POST, the user submitted data is in the Request.Form() collection If the HTTP request method is GET, then user submitted data is in the Request.QueryString() collection any other difference? and Any example would be greatly appreciated. In Request.Form the data is posted in http header whereas in QueryString data is sent through url. I found some other difference Request("id") will first try to locate Request.Form("id") then Request.Querystring("id")

Why is Request.QueryString readonly?

為{幸葍}努か 提交于 2019-12-01 05:50:19
I thought you couldn't change the QueryString on the server without a redirect. But this code works* for me: Request.QueryString edit I'm so amazed. So here are my questions regarding this: Why is Request.QueryString readonly? Why does this code/hack work*? How safe is it, if you change to readonly as soon as you are done editing, both regarding bad errors or unexpected behaviour, and regarding maintaining and understanding the code? Where in the event cycle would it make most sense to do this crazy edit if you are only using PageLoad and OnPageRender? *More details: I have a page with items

Node.js - Send and receive Array as GET/POST using querystring

こ雲淡風輕ζ 提交于 2019-11-30 18:28:45
I've got the following code, but it doesn't seem to work: var post_req = { array: [ [ { param1: 'something', param2: 123 } ], [ ], [ ], [ { param2: 'something', param4: 1234, param1: 'hello' } ] ] }; var data_send = querystring.stringify(post_req); var request = client.request('POST', '/', headers); request.end(data_send); and if( req.method == 'POST' ) { req.addListener('data', function(chunk) { POST = querystring.parse(chunk); console.log(POST); } } I end up with 5 sub-arrays, corresponding to the 5 parameters in the objects but with extra '][' characters in their names: { array: [ { ']