0

This is the code i used to passing 1 value:

 if (Chbk_NewProject.Checked )
 {
     Response.Redirect("PropertiedDetailsByTypeList.aspx?id=" + 1 + "&text=" + HF_SEARCH.Value);
 }
 if (Chbk_Resale.Checked)
 {
    Response.Redirect("PropertiedDetailsByTypeList.aspx?id=" + 2 + "&text=" + HF_SEARCH.Value);
 }
 if (Chbk_Resale.Checked)
 {
    Response.Redirect("PropertiedDetailsByTypeList.aspx?id=" + 3 + "&text=" + HF_SEARCH.Value);
  }

I want to pass multiple value in response.redirect.

For example:

 if (Chbk_NewProject.Checked && Chbk_Resale.Checked )
 {
    Response.Redirect("PropertiedDetailsByTypeList.aspx?id=" + 1 + "&text=" + HF_SEARCH.Value);
 }

In this both checkbox value need to pass..Can anyone help me please?

Jaydip Jadhav
  • 12,179
  • 6
  • 24
  • 40

2 Answers2

0

If understood your requirement correctly then try below solution. if you want to pass both value to query string then you have to add two new variables to store these values.

 if (Chbk_NewProject.Checked && Chbk_Resale.Checked )
 {
   Response.Redirect("PropertiedDetailsByTypeList.aspx?id1=1&id2=2&text=" + HF_SEARCH.Value);
                                                     ---^  ---^
 }
Jaydip Jadhav
  • 12,179
  • 6
  • 24
  • 40
0

@Anju Muralidharan try this..

    if (Chbk_NewProject.Checked && Chbk_Resale.Checked )
     {
       Response.Redirect("PropertiedDetailsByTypeList.aspx?id1=1&id1=2&text=" + HF_SEARCH.Value);
                                                         ---^  ---^
     }

Then Request.Querystring("id1") will return 1,2

This can then be put into an ArrayList like Request.Querystring("id").split(",")

like this.. field1=value1&field1=value2&field1=value3...

passing more then one value with the querystring with the same id

Community
  • 1
  • 1
Mohit Solanki
  • 261
  • 3
  • 17