Page Parameter

3 posts, 0 answers
  1. Nikola
    Nikola avatar
    65 posts
    Member since:
    Sep 2012

    Posted 21 Nov 2012 Link to this post

    heey 

    I have 3 different RadComboBoxs in one page and the 3 RadComboboxes in another page is it somehow possible to transfer the selected values from the first three Comboboxes to the other Comboboxes (Maybe via URL Javascript ) ?

    if you need my code just ask

    Thanks for help and fast answer

  2. Kostadin
    Admin
    Kostadin avatar
    1733 posts

    Posted 23 Nov 2012 Link to this post

    Hello,

    When a form containing the fields (field1, field2, field3) is submitted, the content of the fields is encoded as a query string as follows: field1=value1&field2=value2&field3=value3...
    So in your case you should pass the parameters as follows: 
    Response.Redirect("QStringTest.aspx?ComboBox1=" + value1 + "&ComboBox2=" + value2 +"&ComboBox3=" + value3 ).

    And retrieve them as follows:
    protected void Page_Load(object sender, EventArgs e)
    {
        RadComboBox1.Text = Request.QueryString["ComboBox1"];
        RadComboBox2.Text = Request.QueryString["ComboBox2"];
        RadComboBox3.Text = Request.QueryString["ComboBox3"];
    }


    Kind regards,
    Kostadin
    the Telerik team
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
  3. Nikola
    Nikola avatar
    65 posts
    Member since:
    Sep 2012

    Posted 23 Nov 2012 Link to this post

    heey 

    But sry after some days i got it by myself,and your solution is really  bad .... 
     
    I thing that that one better 

    Frist Page code behind 
    Response.Redirect("~/Report/MonthYearReport.aspx?id1=" + rcbLocationBusinessUnits.SelectedValue + "&id2=" + rcbBusinessUnits.SelectedValue+"&id3="+rcbDepartments.SelectedValue );

    Second Page  code behind  

    string cmb1Value = Request.QueryString["id1"].ToString();
    string cmb2Value = Request.QueryString["id2"].ToString();
    string cmb3Value = Request.QueryString["id3"].ToString();
     
    int index1 = -1;
    index1 = rcbLocationBusinessUnits.FindItemIndexByValue(cmb1Value);
    rcbLocationBusinessUnits.SelectedValue = cmb1Value;
     
    int index2 = -1;
    index2 = rcbBusinessUnits.FindItemIndexByValue(cmb2Value);
    rcbBusinessUnits.SelectedValue = cmb2Value;
     
    int index3 = -1;
    index3 = rcbDepartment.FindItemIndexByValue(cmb3Value);
    rcbDepartment.SelectedValue = cmb3Value;
     
     
    if (!Page.IsPostBack)
    {
        LoadYear();
        LoadMonth();
        LoadLBU();
        if (index2 > -1)
        {
            LoadBU(index1.ToString());
        }
        if (index3 > -1)
        {
            LoadDep(index2.ToString());
        }
     
     
    }

     
Back to Top