0

我在一个页面中有 3 个不同的 RadComboBoxs,在另一个页面中有 3 个 RadComboboxes 是否可以将选定的值从前三个 Comboboxes 传输到其他 Comboboxes(可能通过 URL Javascript)?

如果您需要我的代码,请询问

4

1 回答 1

0

首先尝试查询字符串:

在 Page1.aspx 中

在某些按钮单击事件中

Response.Redirect("~/Page2.aspx?id1="+RadComboBox1.SelectedValue+"&id2="+RadComboBox2.SelectedValue)

在 Page2.aspx 中

在页面加载事件中

string cmb1Value = Request.QueryString["id1"].ToString();
string cmb2Value = Request.QueryString["id2"].ToString();

并将这些值绑定到此处所需的组合框,如下所示。

//Use RadComboBox.SelectedIndex
int index1 = RadComboBox1.FindItemIndexByValue(cmb1Value );
RadComboBox1.SelectedIndex = index1;

int index2 = RadComboBox2.FindItemIndexByValue(cmb2Value );
RadComboBox2.SelectedIndex = index2;
于 2012-11-22T10:47:21.527 回答