asp.net
1. On the asp.net page, execute the JSP (1), add in Pageload. Attributes.Add
THIS.IMGSELECTBATCHID.ATTRIBUTES.ADD ("onclick", "Selectswatchcheckbill" (ctlproductid,ctlnofitycom,ctlcheckbillid , Ctlselbatchid); ");
The corresponding JSP process
function Selectswatchcheckbill (Productid,companyid,incheckbillid,batchid)
{
Para=productid.value
Para1=companyid.value
var obj = new Object ();
Obj. Var1=batchid;
Obj. Var2=incheckbillid;
window.showModalDialog ('.. /selectforms/selectframe.aspx?url= '.. /selectforms/sglselectswatch.aspx&type= ' +para+ ' &companyid= ' +para1,obj,
' Dialogheight=580px;dialogwidth=700px;status=no;edge=raised;scroll=no ');
}
ASPX code page, getting query parameters
private String Type
{
Get
{
if (viewstate["Type"]!= null)
return viewstate["Type"]. ToString ();
Else
Return "";
}
Set
{
viewstate["Type"] = value;
}
}
private String CompanyID
{
Get
{
if (viewstate["CompanyID"]!= null)
return viewstate["CompanyID"]. ToString ();
Else
Return "";
}
Set
{
viewstate["CompanyID"] = value;
}
}
private void Page_Load (object sender, System.EventArgs e)
{
if (! IsPostBack)
{
Try
{
Type = request.querystring["type"]. ToString ();
CompanyID = request.querystring["CompanyID"]. ToString ();
}
Catch
{}
}
}
2. When the Asp/asp.net page is loaded, execute the JS process
<script language= "JavaScript" >
function Populatedata ()
{
}
</script> <body ms_positioning= "GridLayout" background= ". /.. /.. /images/mailuserbg.gif ">
<script language= "JavaScript" >
function Setcookie (sname, svalue)
{
Document.cookie = sname + "=" + Escape (svalue) + ";";
}
</script>
<body onload= ' SetInterval ("Re ()", (GetCookie ("Uds_refreshtime")) ==null?30000:getcookie ("Uds_refreshtime")) ' >
<body onload= ' javascript:if (this.document.all.txtusername.value== "") This.document.all.txtUsername.focus (); else This.document.all.txtPassword.focus (); ' >
<body >
<body >
<body query_string "]. ToString ()%> ', ', ' Toolbar=no, Menubar=no, Scrollbars=yes, Resizable=yes, Location=no, Status=no '); >
3.asp.net page, server control to the JS Process Execution (2)
<script language= "JavaScript" >
function Selquerybatchex (PARA,PARA1,PARA1,PARA2,PARA3,PARA4,PARA5)
{
var rtnval = window.showModalDialog ('.. /.. /selectform/selectquerybatch.aspx?opener= ' + para+ ' &b= ' +para1+ ' &c= ' +para2+ ' &d= ' +para3+ '-' &E= ' para4+ ' &f= ' +para5, ', ' dialogwidth=600px;dialogheight=400px;status=no;edge=raised;scroll=no ');
if (rtnval!= null)
{
if (Rtnval.val2 = = ' OK ')
{
Para.value = Rtnval.val1;
document.forms[0].elements[' Txtbatch '].value=rtnval.val1;
}
}
}
The following process and, in pageload, are equivalent by IMGSELBATCH.ATTRIBUTES.ADD
This. IMGSELBATCH.ATTRIBUTES.ADD ("onclick", "Selquerybatchex" (' Txtbatch ', ' txta ', ' txta ', ' txta ', ' txta ', ' txta '); ");
function Selectbatch (e)
{
if (event.srcelement.id== "Imgselbatch")
{
Return Selquerybatchex (' Txtbatch ', ' txta ', ' txta ', ' txta ', ' txta ', ' txta ');
}
}
Document.onclick = Selectbatch;
</script>