国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 編程 > .NET > 正文

asp.net開發(fā)隨筆

2024-07-10 13:12:06
字體:
來源:轉載
供稿:網(wǎng)友

1.在asp.net頁面上,執(zhí)行jsp(1),在pageload中,添加.attributes.add

    this.imgselectbatchid.attributes.add("onclick","selectswatchcheckbill(ctlproductid,ctlnofitycom,ctlcheckbillid,ctlselbatchid);");

對應的 jsp過程

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的代碼頁,取得查詢參數(shù)

  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.在asp/asp.net頁面加載時,執(zhí)行js過程

<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');close();">

3.asp.net頁面中,服務器控件對js過程的執(zhí)行(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;
      
     }
    }
   }
   

//以下過程和,在pageload中,用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>

發(fā)表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發(fā)表
主站蜘蛛池模板: 长沙县| 昌都县| 永宁县| 买车| 乳源| 永嘉县| 仙桃市| 环江| 财经| 沈阳市| 四平市| 开封市| 常州市| 辉县市| 庆云县| 宁陵县| 汝州市| 新乐市| 静宁县| 大田县| 澄迈县| 醴陵市| 安平县| 共和县| 常州市| 广元市| 南澳县| 克拉玛依市| 龙岩市| 鄂温| 紫云| 平谷区| 淳安县| 芮城县| 乌苏市| 宜丰县| 德钦县| 廊坊市| 晋中市| 辽宁省| 桓仁|