473,394 Members | 1,879 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,394 software developers and data experts.

C# Web: how to use variable in query string

Trying to figure out what the syntax is to say that I'll except any result of a query value in a string. In the code below, for the first case statement, I want any number returned for "paging=" part of the url to work for that case statement.

Thanks!

Expand|Select|Wrap|Line Numbers
  1. if((Request.ServerVariables["QUERY_STRING"] != null))
  2. {
  3.     switch(Request.ServerVariables["QUERY_STRING"])
  4.     {
  5.         case "Paging=WHAT DO I PUT HERE?":                
  6.                 lnkto.NavigateUrl ="http://dev.xxxxx.com/TitleList.aspx?searchType=" +ms.SearchType.ToString() + "&categoryid=" + ms.SearchCategoryID.ToString() + "&searchText=&CategoryPrefer=tv&category=All";
  7.                 lblto.Text = "View It worked Content";
  8.                 break;
  9.         case "searchType=2&searchText=&CategoryID=":
  10.                 lnkto.NavigateUrl = "http://dev.xxxxx.com/TitleList.aspx?searchType=2&CategoryPrefer=movies&searchText=&category=All";
  11.                 lblto.Text = "View All Movies";
  12.                 break;
  13.         default: lnkto.NavigateUrl ="http://dev.xxxxx.com/TitleList.aspx?searchType=4&searchText=&CategoryPrefer=tv&category=All";
  14.                 lblto.Text = "View All Content";
  15.                 break;        
  16.     }
  17. }
Jan 12 '08 #1
2 1767
int08h
28
You can get the value through Request.QueryString[key] where key is "Paging" in your case

string str = Request.QueryString["Paging"];
switch (str)
{
//Add implementation
}
Jan 12 '08 #2
You can get the value through Request.QueryString[key] where key is "Paging" in your case

string str = Request.QueryString["Paging"];
switch (str)
{
//Add implementation
}
Hmm, it seems I can't use a case/switch setup with that though, because they don't accept variables.
Jan 13 '08 #3

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

Similar topics

4
by: bofh | last post by:
I'm working on a project where I need to store a CGI query in a database field. The query contains variables which will be substitued at runtime (e.g., today's date, key to select upon, etc), and...
12
by: vincent_delft | last post by:
I'm looking for a Web Tool kit to build web pages with the following criteria (in priority order) : - easy to use, develop (reuseability of code, ...) - flexible (ideally should run with Python...
8
by: FS Liu | last post by:
Hi, I am writing ATL Service application (XML Web service) in VS.NET C++. Are there any sample programs that accept XML as input and XML as output in the web service? Thank you very much.
1
by: johnpremi | last post by:
Hi there, I have to pass a query string parameter in my Web Config for loading a URL. We have two environments (production and devlopment) and MonitorURL needs to be changed when the deployment is...
0
by: Richard Gregory | last post by:
Hi, I have the wsdl below, for an Axis web service, and when I select Add Web Refernce in Visual Studio the proxy is missing a class representing the returnedElementsType (see reference.cs below...
3
by: James Robertson | last post by:
I am new to the ASP and VB thing so be kind. Question I have is that I have created an ASPX web site to use as an E-Mail page. But I want to use this for a lot of users. Can I create the link on...
0
by: James Robertson | last post by:
OK so I have that and get it. Now here is my code, I want to insert the www.mydomain.com?email=username@domain.com to the string "USER@DOMAIN.NET" to accept the variable from elier. How and where?...
4
by: pmcgover | last post by:
I enjoyed Paul Barry's September article in Linux Journal entitled, "Web Reporting with MySQL, CSS and Perl". It provides a simple, elegant way to use HTML to display database content without any...
0
by: Bishoy George | last post by:
Hi, I have a asp.net 2.0 web application. I want to implement the asynchronous model through http handler in web.config ...
2
by: Looch | last post by:
All, I'm trying to output but I can only get (brackets for clarity) when using the code below. How can I "break" into the query variable in the InsertName method to add the name parameter to...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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?
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
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,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
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...
0
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...

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.