弹出模式窗口,返回值

js 代码:

function show(txtHsCodeID,txtStoreNameID,txtHsCodeID2)
{
//txtHsCode为
//item为textobx1的ID,ID为Textbox2。ID
var value = document.getElementById(txtHsCodeID).value;
//window.alert(value);
var modalReturnValue;//模式的返回值
modalReturnValue=window.showModalDialog('../FrmHSCode.aspx?HsCode='+value+ '&StoreNameID='+txtStoreNameID+'&HsCodeID='+txtHsCodeID+'&HsCodeID2='+txtHsCodeID2);
// k=window.showModalDialog('../FrmHSCode.aspx?name='+value+'&ID='+ID+"&ID1="+item);
//modalReturnValue.onFocus();

if(modalReturnValue!=null)
{
var arry = new Array();
arry = modalReturnValue.split(",");//一般返回一个字符串,用斗号分割
document.getElementById(txtHsCodeID2).value =arry[0];//hs编码textbox获取的值
document.getElementById(txtStoreNameID).value=arry[1];//商品名称货物的值
}
return false;
}

if (e.Row.RowIndex > -1)
{
HtmlInputText txtHsCode1 = e.Row.FindControl("txtHsCode1") as HtmlInputText;
HtmlInputText txtStoreName = e.Row.FindControl("txtStoreName") as HtmlInputText;
HtmlInputText txtHsCode2 = e.Row.FindControl("txtHsCode2") as HtmlInputText;
HtmlInputText txtType = e.Row.FindControl("txtType") as HtmlInputText;//规格内型
HtmlInputText txtAmount = e.Row.FindControl("txtAmount") as HtmlInputText;//数量
HtmlInputText lblKg = e.Row.FindControl("lblKg") as HtmlInputText;//单位
HtmlInputText txtCargoMoney = e.Row.FindControl("txtCargoMoney") as HtmlInputText;//单价
DropDownList drpMoneyType = e.Row.FindControl("drpMoneyType") as DropDownList;//币制
HtmlInputText txtWeight = e.Row.FindControl("txtWeight") as HtmlInputText;//总量
LinkButton lnkCheck =e.Row.FindControl("lnkCheck") as LinkButton;
lnkCheck.Attributes.Add("onclick", "return show('" + txtHsCode1.ClientID + "','" + txtStoreName.ClientID + "','"+txtHsCode2.ClientID+"')");
//LB1.Attributes.Add("onclick", "show('" + txt1.ClientID + "','" + txt2.ClientID + "')");

Button btn = e.Row.FindControl("btnDelete") as Button;
//重写功能
btn.Attributes.Add("onclick", "reset('" + txtHsCode1.ClientID + "','" + txtStoreName.ClientID + "','" + txtHsCode2.ClientID + "','" + txtType.ClientID + "','" + txtAmount.ClientID + "','" + lblKg.ClientID + "','" + txtCargoMoney.ClientID + "','" + drpMoneyType.ClientID + "','" + txtWeight.ClientID + "')");
}





if (e.Row.RowIndex > -1)
{
e.Row.Attributes.Add("ondblclick", "show('" + hsCodeID2 + "','" + storeNameID + "','" + e.Row.Cells[0].Text + "','" + e.Row.Cells[1].Text + "')");
//e.Row.Attributes.Add("ondblclick", "show('" + e.Row.Cells[0].Text + "','" + e.Row.Cells[1].Text + "')");
}

留言

這個網誌中的熱門文章

嘗試卸載資料庫時,發生資料庫正在使用的而無法卸載的可能解決方案

ASP.NET常用的RegularExpressionValidator驗證