locked
Passing Dropdown's value from 1 page to another when DDL are created in User control page RRS feed

  • Question

  • User67440516 posted

    I have a user control Search_Admin.ascx and Search_Admin.ascx.cs page, which has 8 RadComboBox(telerik's drop down). and two ASPX pages namely SearchPage.aspx and SavedSearches.aspx., which have inherited the user control page When I am clicking on Save Filters Button on SearchPage.aspx, those 8 drop down control should be able to pass the selected value from SearchPage.aspx to SavedSearches.aspx.Object data source is used as a mark up in ddllists markup

    User Control page :    Search_Admin.ascx                                      Search_Admin.ascx .cs ASPX

     Page 1:              SearchPage.aspx.                                      SearchPage.aspx.cs ASPX

    Page 2:              SavedSearches.aspx                                     SavedSearches.aspx.cs
    Please help in this step.Its urgent.Thanks.

    Sunday, January 27, 2013 4:35 AM

Answers

  • User3866881 posted

    Hi,

    Not sure because you are using RadControlTextBox, which doesn't belong to Microsoft.

    I mean that you can try to save the Value into Session first, and then even if you jump to another page, please directly retrieve the value from the Session.

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Monday, January 28, 2013 9:09 PM
  • User-1034726716 posted

    Hi and Welcome to the ASP.NET community forums!

    Actually there are many ways how to pass information between pages and these includes the following:

    • Sessions
    • Querystrings
    • Cross-Page Posting
    • Cookies
    • Form Submit
    • Server.Transfer

    Here's an example using Session:

    At DropDownList selectedindex changed or at Button click event you can do like this:

    Session["KeyName"] = DropDownList1.SelectedItem.Text;
    Response.Redirect("SearcgPage.aspx");
    

    Then at the recieving page you can grab the data from Session object like this:

    protected void Page_Load(object sender, EventArgs e){
            if (Session["KeyName"] != null)
            {
                //get the Session value
                string someVariableName = Session["KeyName"].ToString();
            }
    }

    Here's an example using QueryString:

    string someVariableName = DropDownList1.SelectedItem.Text;
    Response.Redirect(string.Format("SearchPage.aspx?param1={0}",someVariableName));
    

    Then you can get the value from the recieving page like this:

    protected void Page_Load(object sender, EventArgs e)
    {
            if (Request.QueryString["param1"] != null)
            {
                string someVariableName= Request.QueryString["param1"];
            }
    }

    And of course, doing a simple search from google/bing will give you lots of examples. Just search for "passing data between pages in asp.net".




    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Tuesday, January 29, 2013 1:24 AM

All replies

  • User3866881 posted

    Hi,

    Not sure because you are using RadControlTextBox, which doesn't belong to Microsoft.

    I mean that you can try to save the Value into Session first, and then even if you jump to another page, please directly retrieve the value from the Session.

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Monday, January 28, 2013 9:09 PM
  • User-1034726716 posted

    Hi and Welcome to the ASP.NET community forums!

    Actually there are many ways how to pass information between pages and these includes the following:

    • Sessions
    • Querystrings
    • Cross-Page Posting
    • Cookies
    • Form Submit
    • Server.Transfer

    Here's an example using Session:

    At DropDownList selectedindex changed or at Button click event you can do like this:

    Session["KeyName"] = DropDownList1.SelectedItem.Text;
    Response.Redirect("SearcgPage.aspx");
    

    Then at the recieving page you can grab the data from Session object like this:

    protected void Page_Load(object sender, EventArgs e){
            if (Session["KeyName"] != null)
            {
                //get the Session value
                string someVariableName = Session["KeyName"].ToString();
            }
    }

    Here's an example using QueryString:

    string someVariableName = DropDownList1.SelectedItem.Text;
    Response.Redirect(string.Format("SearchPage.aspx?param1={0}",someVariableName));
    

    Then you can get the value from the recieving page like this:

    protected void Page_Load(object sender, EventArgs e)
    {
            if (Request.QueryString["param1"] != null)
            {
                string someVariableName= Request.QueryString["param1"];
            }
    }

    And of course, doing a simple search from google/bing will give you lots of examples. Just search for "passing data between pages in asp.net".




    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Tuesday, January 29, 2013 1:24 AM