|
5#
楼主 |
发表于 2014-4-18 22:45:59
|
只看该作者
本帖最后由 shouzhi2007 于 2014-4-18 22:48 编辑
不过我昨天,研究出来了。用数组传的。
用GetWriteBackValueReference ,多传几个值就可以了。
这是传值代码:
- protected void btnSaveClose_Click(object sender, EventArgs e)
- {
- SyncSelectedRowIndexArrayToHiddenField();
- int selectedRowIndex = Grid1.SelectedRowIndex;
- string SparepartsID = Grid1.DataKeys[selectedRowIndex][0].ToString();
- string SparepartsBianhao = Grid1.DataKeys[selectedRowIndex][1].ToString();
- string SparepartsCode = Grid1.DataKeys[selectedRowIndex][2].ToString();
- string SparepartsName = Grid1.DataKeys[selectedRowIndex][3].ToString();
- string SparepartsSpecification = Grid1.DataKeys[selectedRowIndex][4].ToString();
- string Sparepartsprice = Grid1.DataKeys[selectedRowIndex][5].ToString();
- PageContext.RegisterStartupScript(ActiveWindow.GetWriteBackValueReference(SparepartsID, SparepartsBianhao, SparepartsCode, SparepartsName, SparepartsSpecification,Sparepartsprice)
- + ActiveWindow.GetHideReference());
- }
复制代码
这是接受值代码:
- private void InitEquipmentSparepart()
- {
- // 打开编辑窗口
- string selectSparepartURL = String.Format("./Spareparts_select_bianhao.aspx?ids=<script>{0}</script>", hfSelectedSparepart.GetValueReference());
- tbSelectedKcBianhao.OnClientTriggerClick = Window1.GetSaveStateReference(hfSelectedSparepart.ClientID, tbSelectedKcBianhao.ClientID, tbxKcCode.ClientID, tbxKcName.ClientID, tbxKcSpecification.ClientID, nbbKcPrice.ClientID)
- + Window1.GetShowReference(selectSparepartURL, "选择设备名称");
- }
复制代码 |
|