国产探花免费观看_亚洲丰满少妇自慰呻吟_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ā)表
主站蜘蛛池模板: 正宁县| 宁陕县| 澎湖县| 谢通门县| 神农架林区| 行唐县| 德阳市| 克东县| 阿拉善盟| 金昌市| 额尔古纳市| 马尔康县| 鄂伦春自治旗| 南川市| 昔阳县| 曲沃县| 黎城县| 琼结县| 团风县| 突泉县| 凤翔县| 河南省| 辽宁省| 和平县| 萍乡市| 沙田区| 高清| 福州市| 石阡县| 中方县| 江门市| 革吉县| 夏津县| 潍坊市| 凌海市| 谷城县| 游戏| 平安县| 枞阳县| 周至县| 丘北县|