Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. General Programming
  3. Visual Basic
  4. Response.Redirect Query Strings

Response.Redirect Query Strings

Scheduled Pinned Locked Moved Visual Basic
databasevisual-studiotutorialquestion
3 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • B Offline
    B Offline
    Boycech
    wrote on last edited by
    #1

    Can somebody please tell me how to place a dropdownlist on one page in VS with a couple items on it, and then a label on another page to accept the value you selected on the first page? Basically I need to know how to redirect to another page with the selected value and then accept and display it. Thank you CB

    R 1 Reply Last reply
    0
    • B Boycech

      Can somebody please tell me how to place a dropdownlist on one page in VS with a couple items on it, and then a label on another page to accept the value you selected on the first page? Basically I need to know how to redirect to another page with the selected value and then accept and display it. Thank you CB

      R Offline
      R Offline
      ramaseb
      wrote on last edited by
      #2

      I hope that i had undestund what you want. See this example , the idea is that the user selects from the droplist ( here a set the autopostbask to true ) and i pass the selected item text to the label. When the user press the button "go" te program checks the drop down selected item index and redirects the user to the coresponding page. Hope i helped you Ramaseb --------------------------------------- Public Class WebForm1 Inherits System.Web.UI.Page #Region " Web Form Designer Generated Code " 'This call is required by the Web Form Designer. Private Sub InitializeComponent() End Sub Protected WithEvents Drop1 As System.Web.UI.WebControls.DropDownList Protected WithEvents Label1 As System.Web.UI.WebControls.Label Protected WithEvents Button1 As System.Web.UI.WebControls.Button 'NOTE: The following placeholder declaration is required by the Web Form Designer. 'Do not delete or move it. Private designerPlaceholderDeclaration As System.Object Private Sub Page_Init(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Init 'CODEGEN: This method call is required by the Web Form Designer 'Do not modify it using the code editor. InitializeComponent() End Sub #End Region Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load 'Put user code to initialize the page here If Not Page.IsPostBack Then Drop1.Items.Clear() Drop1.Items.Add("page 1") Drop1.Items.Add("page 2") Drop1.Items.Add("page 3") End If End Sub Private Sub Drop1_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles Drop1.SelectedIndexChanged Label1.Text = Drop1.SelectedItem.Text End Sub Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click Select Case Drop1.SelectedIndex Case 0 Response.Redirect("mypage1.aspx") Case 1 Response.Redirect("mypage2.aspx") Case 2 Response.Redirect("mypage3.aspx") End Select End Sub End Class Ramaseb.

      B 1 Reply Last reply
      0
      • R ramaseb

        I hope that i had undestund what you want. See this example , the idea is that the user selects from the droplist ( here a set the autopostbask to true ) and i pass the selected item text to the label. When the user press the button "go" te program checks the drop down selected item index and redirects the user to the coresponding page. Hope i helped you Ramaseb --------------------------------------- Public Class WebForm1 Inherits System.Web.UI.Page #Region " Web Form Designer Generated Code " 'This call is required by the Web Form Designer. Private Sub InitializeComponent() End Sub Protected WithEvents Drop1 As System.Web.UI.WebControls.DropDownList Protected WithEvents Label1 As System.Web.UI.WebControls.Label Protected WithEvents Button1 As System.Web.UI.WebControls.Button 'NOTE: The following placeholder declaration is required by the Web Form Designer. 'Do not delete or move it. Private designerPlaceholderDeclaration As System.Object Private Sub Page_Init(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Init 'CODEGEN: This method call is required by the Web Form Designer 'Do not modify it using the code editor. InitializeComponent() End Sub #End Region Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load 'Put user code to initialize the page here If Not Page.IsPostBack Then Drop1.Items.Clear() Drop1.Items.Add("page 1") Drop1.Items.Add("page 2") Drop1.Items.Add("page 3") End If End Sub Private Sub Drop1_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles Drop1.SelectedIndexChanged Label1.Text = Drop1.SelectedItem.Text End Sub Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click Select Case Drop1.SelectedIndex Case 0 Response.Redirect("mypage1.aspx") Case 1 Response.Redirect("mypage2.aspx") Case 2 Response.Redirect("mypage3.aspx") End Select End Sub End Class Ramaseb.

        B Offline
        B Offline
        Boycech
        wrote on last edited by
        #3

        Actually, I was looking to select the value Page1 from Drop1 on the main page. When you select Page1 it then redirects you to Page1, accepts the value, and displays it in Label1 on Page1 without a submit button. Thanks much!

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups