asp.net development essay

Source: Internet
Author: User
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>



Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.