473,951 Members | 60,526 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Request.queryst ring fun

20 New Member
Hello,

I am developing a forums for asp.net, in doing this I am using code behind to do all validation on users and roles and then using embedded ASP to do the displaying for categories, sections and threads!

The problem I am having is, when you first navigate to the site you pass the forum name in a querystring. So foe example: forumid=testfor um

I do this because the site will host multiple forums and this will allow me to use one DB to host multiple forums.

Anyway, it works fine the first time you visit the site but if you navigate away from the page, staying on the site, so you visit another page of the site, then come back to the page by clicking the link to the forums my page does not pick up the querystring.

The url shows it being displayed but in the code, both behind and ASP side show that that

Expand|Select|Wrap|Line Numbers
  1. Dim forum_name as string = request.querystring(“ForumID”) 
This shows that the
Expand|Select|Wrap|Line Numbers
  1. request.querystring(“forumID”) = “” 
or to null.

This also happens if I hit Refresh on the page.

Please note that links are found in a master page(may be the problem)

Anyone have any ideas please let me know.
Oct 24 '07 #1
4 2980
jhardman
3,406 Recognized Expert Specialist
moved to .NET forum. In dot net can you do something like this:
Expand|Select|Wrap|Line Numbers
  1. for each x in request.querystring
  2.    response.write x & ": " & request.querystring(x) & "<br>" & vbNewLine
  3. next
? This is how I would address the problem in classic ASP. The reason is this will distinguish between not sending an argument and sending an empty querystring. If there is a querystring that is recognized as having no value, it should still be listed this way, but if a querystring is not recognized it shouldn't show up.

Jared
Oct 25 '07 #2
Plater
7,872 Recognized Expert Expert
I believe the keys are case sensitive?
Oct 25 '07 #3
jhardman
3,406 Recognized Expert Specialist
I believe the keys are case sensitive?
That might depend on what language is being used, classic ASP is case-insensitive,but it sure looks like he's using .NET. Anyway, I still think printing out all the data sent through the querystring is a good idea for troubleshooting purposes.

Jared
Oct 25 '07 #4
Plater
7,872 Recognized Expert Expert
True, but that won't show him the keys necessarily.


To see all the a parameters (and their keys):
Expand|Select|Wrap|Line Numbers
  1. string n="";
  2. foreach (string key in Request.Params.AllKeys)
  3. {
  4.    n += key + ": " + Request.Params[key] + "<br/>\r\n";
  5. }
  6. Response.WriteLine(n);
  7.  
For VB:
Expand|Select|Wrap|Line Numbers
  1. Dim n As String = "" 
  2. For Each key As String In Request.Params.AllKeys 
  3.     n += key + ": " + Request.Params(key) + "<br/>" & vbNewLine
  4. Next 
  5. Response.WriteLine(n) 
  6.  
Oct 25 '07 #5

Sign in to post your reply or Sign up for a free account.

Similar topics

5
2595
by: momo | last post by:
Hello Newsgroup, I want to pass a Request.Form variable to an ASP form, through the url for example lets say i have a form with a textfiled called "txtName" if i click the submit button for example the asp page reads the content of this txtName as Request.Form("txtName") I want to achieve that the asp form is accessed through a URL where i can pass the value of txtName without going to the page of the form and clicking
4
2760
by: Max | last post by:
Hello. This is the first time I've posted to a newsgroup, and I do this because I'm in desperate need of help. I'm working a user management system, and when I activate a user that has registered to my system, the current admin user logged in gets logged out. I can't seem to work out how - I can't even trace back where some of the variables are coming from (for example, the "ref" part of the Request.QueryString method). Could someone...
5
2434
by: Ivan | last post by:
hi, I saw some program using "request("fieldname") " instead of "request.QueryString" to get the value from URL, what's the different ?? thanks
0
3115
by: Anders Borum | last post by:
Hello! I would like to request a new method on the XsltArgumentList class, allowing developers to check the presense of a key/value pair. If you try to add a key/value pair that has already been defined in the list, an exception is thrown. Rather than using the "GetParam" method, it would be usefull to have a method called ".Exists" available on the XsltArgumentList. I think this allows for cleaner and more readable code. Or, perhaps...
1
1895
by: FD | last post by:
For performance reason, the follwoing code (C#) to capture all the Request collection contexts is NOT recommended: string ID = Request.QueryString; But how to Capture the individual Request properties needed in the application? Thanks, FD
4
13281
by: Steve | last post by:
Hi- I'd like to set values in the QueryString if I detect that a user submits a bad value, say... ?id=333 where there is no id '333', I would like to set it to '0' for example. I tried to use Request.QueryString.Set("id", "0"); it says it is Read Only. How can this be done? Why is there a Set() method if you can't use it?
2
1849
by: mahsa | last post by:
Hi have have some link like thi http://x.com/Shoppingcart.aspx?pn=ps50210&qty_ps50210=1&pn=excel&qty_excel=1&pn=l4504000&qty_l4504000=1&sku=PS50210&cat=laminate&action=updat now I want to request the dat I use this code in as <%For Each strPartNo In Request.QueryString("pn" lngQty = Request.QueryString("qty_" & strPartNo strPartNo = LCase(strPartNo Response.Write("strPartNo"& strPartNo& lngQty Next %
4
25376
by: Guoqi Zheng | last post by:
On my application, I need to have different action based on the pass in query string. When the query string is not presented, I try to use If request.querystring("id") ="" THEN ...... This is what I did in trational asp, however if I did abov in ASP.NET, I always got an error of "Object reference not set to an instance of an object. " How should I solve the problem?
6
3831
by: Ammar | last post by:
Dear All, I'm facing a small problem. I have a portal web site, that contains articles, for each article, the end user can send a comment about the article. The problem is: I the comment length is more that 1249 bytes, then the progress bar of the browser will move too slow and then displaying that the page not found!!!! If the message is less than or equal to 1249 then no problem.
7
9670
by: =?Utf-8?B?QVRT?= | last post by:
HOWTO Make CStr for JavaScript on ASP w/ Request.Form and QueryString In ASP, Request.Form and Request.QueryString return objects that do not support "toString", or any JavaScript string operation on parameters not passed. Example: Make a TST.asp and post to it as TST.asp?STATE=TEST <%@ Language=JavaScript %> <%
0
10172
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
11602
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
11195
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
11371
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10703
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9904
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
7444
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
6235
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
4967
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.