locked
Response.Redirect Parsing RRS feed

  • Question

  • User-498848506 posted

    I have the following string that I am sending to another page to fill-in the appropriate values for each of the named segments.

    Response.Redirect("Page__Detail_Input_1.aspx?ErrorLabel=" + MsgText1 & "HealthCond=" + HealthIn & "Fever=" + ddlFeverText & "Country=" + ddlCountryText & "Cough=" + ddlCoughText & "Breath=" + ddlBreathText & "")

    In VB.Net how do I parse each of the component parts, e.g. HealthCondition, Fever, Country... etc. to populate either a TextBox or a Label? I have tried using <%Response.Write(Request.QueryString("ErrorLabel"))%>'> it displays all the data, but I cannot parse it.

    Thanks

    Friday, March 20, 2020 10:21 PM

Answers

  • User409696431 posted

    Request.QueryString("ErrorLabel") will get the value for the querystring parameter "ErrorLabel", Request.QueryString("HealthCond") will get the value for the querystring parameter "HealthCond", and so on.  If it returns anything more than that, check what value you are actually sending in the Redirect address.  Your creation of the string for the Redirect looks wrong, where you are not quoting the ampersands and appending them to the string with a +.

    Try

    Response.Redirect("Page__Detail_Input_1.aspx?ErrorLabel=" + MsgText1 + "&HealthCond=" + HealthIn + "&Fever=" + ddlFeverText + "&Country=" + ddlCountryText + "&Cough=" + ddlCoughText + "&Breath=" + ddlBreathText)

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Saturday, March 21, 2020 12:33 AM

All replies

  • User409696431 posted

    Request.QueryString("ErrorLabel") will get the value for the querystring parameter "ErrorLabel", Request.QueryString("HealthCond") will get the value for the querystring parameter "HealthCond", and so on.  If it returns anything more than that, check what value you are actually sending in the Redirect address.  Your creation of the string for the Redirect looks wrong, where you are not quoting the ampersands and appending them to the string with a +.

    Try

    Response.Redirect("Page__Detail_Input_1.aspx?ErrorLabel=" + MsgText1 + "&HealthCond=" + HealthIn + "&Fever=" + ddlFeverText + "&Country=" + ddlCountryText + "&Cough=" + ddlCoughText + "&Breath=" + ddlBreathText)

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Saturday, March 21, 2020 12:33 AM
  • User-498848506 posted

    I've retired and been away from this for over 6 years. With all that's going on I needed to find something to keep me occupied, so I'm re-working some of my old programs and reinventing them for new uses...I'm rusty but its coming back slowly! Thank you for your help!

    Saturday, March 21, 2020 1:19 AM
  • User409696431 posted

    You're welcome.  Have fun!

    Saturday, March 21, 2020 2:47 AM