473,385 Members | 1,707 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Is there an existing .NET method for combining querystring vars correctly?

I am wondering if there is a build-in method in .NET for arbitrarily and
correctly combining/concatenating querystring variables into a valid
querystring.

i.e. I might have the following vars I want to put into a valid querystring:
id=200
action=doStuff

I have a user control that might sometimes be appending vars to a URL that
might have no vars:

http://whatever.com/index.asp

....or might have one var:

http://whatever.com?foo=bar

....or might have several values...

http://whartever.com?foo=bar&max=200

or might have # "fragment identfiers"/anchor references mixed in.

Is there a .NET method that will tack on a new variable to a valid
querystring in the correct form, or do I need to make this myself? This is
not hard but someone else has already done the work, I'll take that.

-KF

Jan 22 '08 #1
1 1050
Hi Ken,

There's no built-in function to help you achieve this but if you need to
implement it yourself, inheriting from UriBuilder should be the easiest
approach; for example:

Extended UriBuilder to get/set individual querystring items... - ASP.NET
Forums (http://forums.asp.net/t/693414.aspx)

Regards,
Walter Wang (wa****@online.microsoft.com, remove 'online.')
Microsoft Online Community Support

==================================================
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
==================================================

This posting is provided "AS IS" with no warranties, and confers no rights.

Jan 22 '08 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

15
by: Thomas Scheiderich | last post by:
I am trying to understand Session variables and ran into a question on how they work with data that is passed. I have an HTM file that calls an ASP file and sends the name either by GET or POST....
2
by: Chris Mullins | last post by:
I've spent a bit of time over the last year trying to implement RFC 3454 (Preparation of Internationalized Strings, aka 'StringPrep'). This RFC is also a dependency for RFC 3491...
1
by: lion | last post by:
my Problem: a query string passed into a html page doesn't display correctly on a mac I am just using html and javascript (no ASP, PHP or server side scripting) This is the query string:...
7
by: Barry | last post by:
Hi all, I've noticed a strange error on my website. When I print a capital letter P with a dot above, using & #7766; it appears correctly, but when I use P& #0775 it doesn't. The following...
3
by: Mark | last post by:
Hello Can anyone tell me how to check if a a querystring is present or not I.E. If request.querystring("key") is in the url or not because when i try to reference it in anyway and its not...
3
by: exhuma.twn | last post by:
Simple problem: When I define a funtion the way you would with the publisher handler (without using psp), all works as expected. However when I define a publisher-like function and instantiate a...
1
by: radiox | last post by:
Hi guys, I have this html file containing: <html><head> <script src="variable.js?id=1004"></script> </head><body></body></html> I also have the .js file that looks like this...
10
by: John A Grandy | last post by:
Say I have Class1 which contains static Class2 var1 = new Class2(); Is Class2 constructor code only executed if var1 is referenced in the code-execution path ? Or is Class2 constructor code...
11
by: Fabio | last post by:
I know the syntax for variable "variabletopass" in ASP: www.destinationpage.asp?variable=<%=variabletopass%> What's the syntax for Javascript? Thks
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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,...
0
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...

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.