trouble passing values in querystrings...

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • abehm
    New Member
    • May 2007
    • 35

    trouble passing values in querystrings...

    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?

    Code:
     protected void btnNext2_Click(object sender, EventArgs e)
        {
            if (MessageBox.Show("Proceed?", "Test Maintenance", MessageBoxButtons.YesNo) == DialogResult.Yes)
                Response.Redirect("TestParameters.aspx?" + GetComponentInfo());
        }
    
        private string GetComponentInfo()
        {
            string compInfo = "Page1=";
            for (int i = 0; i < lstPage1Components.Items.Count; i++)
                compInfo += lstPage1Components.Items[i].Text.ToString();
            compInfo += "&Page2=";
            for (int i = 0; i < lstPage2Components.Items.Count; i++)
                compInfo += lstPage1Components.Items[i].Text.ToString();
            compInfo += "&Page3=";
            for (int i = 0; i < lstPage3Components.Items.Count; i++)
                compInfo += lstPage1Components.Items[i].Text.ToString();
            compInfo += "&Page4=";
            for (int i = 0; i < lstPage4Components.Items.Count; i++)
                compInfo += lstPage1Components.Items[i].Text.ToString();
            compInfo = compInfo.Replace(" ","-");
            return compInfo;
        
        }
  • abehm
    New Member
    • May 2007
    • 35

    #2
    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.queryst ring[0];

    but not if i reference the name, string part1 = request.queryst ring["Part1"];

    Comment

    Working...