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

trouble passing values in querystrings...

abehm
35
Hi, I'm trying to pass multiple values through querystrings to another page where i will parse them to individual variables.

I have one method to create the querystrings before they pass, but for some reason nothing is being passed.

Can anyone help me?

Expand|Select|Wrap|Line Numbers
  1.  protected void btnNext2_Click(object sender, EventArgs e)
  2.     {
  3.         if (MessageBox.Show("Proceed?", "Test Maintenance", MessageBoxButtons.YesNo) == DialogResult.Yes)
  4.             Response.Redirect("TestParameters.aspx?" + GetComponentInfo());
  5.     }
  6.  
  7.     private string GetComponentInfo()
  8.     {
  9.         string compInfo = "Page1=";
  10.         for (int i = 0; i < lstPage1Components.Items.Count; i++)
  11.             compInfo += lstPage1Components.Items[i].Text.ToString();
  12.         compInfo += "&Page2=";
  13.         for (int i = 0; i < lstPage2Components.Items.Count; i++)
  14.             compInfo += lstPage1Components.Items[i].Text.ToString();
  15.         compInfo += "&Page3=";
  16.         for (int i = 0; i < lstPage3Components.Items.Count; i++)
  17.             compInfo += lstPage1Components.Items[i].Text.ToString();
  18.         compInfo += "&Page4=";
  19.         for (int i = 0; i < lstPage4Components.Items.Count; i++)
  20.             compInfo += lstPage1Components.Items[i].Text.ToString();
  21.         compInfo = compInfo.Replace(" ","-");
  22.         return compInfo;
  23.  
  24.     }
Jun 21 '07 #1
1 1322
abehm
35
oh wait, i think it's a problem with the way I read them.

if i get each querystring (page1, page2, etc) by referencing the index value, it works. i.e. string part1 = request.querystring[0];

but not if i reference the name, string part1 = request.querystring["Part1"];
Jun 21 '07 #2

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

Similar topics

4
by: Jason Us | last post by:
Does anyone have experience with passing variables from an ASP page to a JSP page. The way it currently works in passing the SSN in the URL. This cannot be good. I thought that storing a...
7
by: Pete | last post by:
Any ideas on how I can set some data in 1.asp, then have 1.asp do a server.transfer (or .execute, come to that) to 2.asp, and have 2.asp access the original data? I'm aware that the Session...
4
by: JA | last post by:
I have this little tell-a-friend script that will send out a link back to the site. I want to put a link on my product pages that will go to the script, and have the script display the product...
3
by: Kelvin Moss | last post by:
Hi all, I am facing a problem with a library that allocates memory internally. My basic problem is how to reflect changes in pointer values back in main. My library routine allocates...
4
by: rick | last post by:
Does anyone having a working example of passing values between web forms pages? I tried the example in the ms- help but I can't get by the following: To read property values from the source...
7
by: Smokey Grindle | last post by:
For a website that has users logged into it using sessions, its it best to pass data between pages in session variables or through query strings?
6
by: Kausar | last post by:
Hello All, How do i pass the value from a page that exists on some domain to another page that exists in subdomain. Regards Kausar
2
by: TCook | last post by:
Hello All, I need to try to programmatically and dynamically populate some lists on a web page. I wanted to know the best advised way to pass the information to the web page. For example,...
6
by: DLP35 | last post by:
I'm sure this should be simple enough but I'm really struggling to get my mind around this. I don't have access to a server but am developing a site and I need to pass information from input boxes...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
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:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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...
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...

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.