locked
Add Hidden Input to query string RRS feed

  • Question

  • User1111777634 posted

    I have a query string that takes the value from a text box and passes it via a query string to a different web page. I need to add a hidden imput (state=MN) but can't get it to work. Everything I have tried hasn't worked. My code behind is below:

    Partial Class Default2

    Inherits System.Web.UI.Page

    Protected Sub LinkButton1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles LinkButton1.Click

    Response.Redirect("http://www.realtor.com/realestateandhomes-search?mlslid,st=" + mlsTextBox.Text, st)

    End Sub

    Protected Sub st_ValueChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles st.ValueChanged

    Dim st As String = "MN"

    End Sub

    End Class

     

     

    Saturday, February 21, 2009 6:57 PM

Answers

  • User-514194766 posted

    Watch this video it might help you : http://www.asp.net/learn/videos/video-11.aspx

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Sunday, February 22, 2009 12:23 PM
  • User1006193418 posted

    Response.Redirect("http://www.realtor.com/realestateandhomes-search?mlslid,st=" + mlsTextBox.Text, st)

    Hi,

    To pass multi-value via query string, you need to use '&' symbol to join them: 

    Response.Redirect("http://www.realtor.com/realestateandhomes-search?mlslid=" & mlsTextBox.Text & "&st=" & st)

    Having a read at this article, you will get more examples and information: Passing variables between pages using QueryString.

    Best Regards,
    Shengqing Yang

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Thursday, February 26, 2009 3:41 AM

All replies

  • User-514194766 posted

    in your case would use a session variable

    Saturday, February 21, 2009 7:37 PM
  • User-1804440612 posted

    COULD YOU PLEASE PROVIDE YOUR FULL HTML CODE & SERVER SIDE CODE. HOPE IT WILL HELP OTHERS TO REPLY YOU.

    REGARDS
    http://shawpnendu.blogspot.com

    Saturday, February 21, 2009 11:46 PM
  • User1111777634 posted

     Below is my code

     <span class="style9">MLS #</span>

    <asp:TextBox ID="mlsTextBox" runat="server" Height="20px" Width="100px"></asp:TextBox>

    &nbsp;<asp:LinkButton ID="mlsLinkButton" runat="server">Go</asp:LinkButton>

    --------------------------------------------------------------------------------------------------------------------------------------------------Below is my Code Behind

    Protected Sub mlsLinkButton_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles mlsLinkButton.Click

    Response.Redirect("http://www.realtor.com/realestateandhomes-search?mlslid=" + mlsTextBox.Text)

    End Sub

     

     

    Sunday, February 22, 2009 11:57 AM
  • User1111777634 posted

    I'm not really sure how to lay it all out, could you please point me to some type of insturctions?

    Sunday, February 22, 2009 11:59 AM
  • User-514194766 posted

    Watch this video it might help you : http://www.asp.net/learn/videos/video-11.aspx

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Sunday, February 22, 2009 12:23 PM
  • User1006193418 posted

    Response.Redirect("http://www.realtor.com/realestateandhomes-search?mlslid,st=" + mlsTextBox.Text, st)

    Hi,

    To pass multi-value via query string, you need to use '&' symbol to join them: 

    Response.Redirect("http://www.realtor.com/realestateandhomes-search?mlslid=" & mlsTextBox.Text & "&st=" & st)

    Having a read at this article, you will get more examples and information: Passing variables between pages using QueryString.

    Best Regards,
    Shengqing Yang

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Thursday, February 26, 2009 3:41 AM
  • User1111777634 posted

    Thanks for your help!

    Thursday, February 26, 2009 9:23 AM