首页 | 软件中心 | Designand Inspiration
读库教程网 > 网络教程 > 网页编程 > .Net 专栏 > .Net技巧 > ASP.NET静态增加恳求单措施及代码

ASP.NET静态增加恳求单措施及代码

添加:2010年5月21日

  一个请求单可以包括N个项目,添加请求单时就须要静态参与代码了。

  静态Table表格

  <table border="0" width="98%" id="tabzx" name="tabzx" align="center"

  width="10%">

  A列

  </td>

  <td width="10%" align="center">

  B列 </td>

  <td width="10%" align="center">

  C列

  </td>

  <td width="5%" align="center">

  D列

  </td>

  <td width="5%" align="center">

  E列

  </td>

  <td width="5%" align="center">

  F列

  </td><%--

  <td width="7%" align="center">

  G列

  </td>

  --%><td width="13%">

  [

  <a href="javascript:doSelect(450,400,'formEdit.supplyId')"><font

  color="FF0000">挑选配备</font> </a>]

  </td>

  </tr>

  </table>

  JS代码如下(依据条件弹出配备列表,然后挑选已有配备)

  function doSelect(Width,Height,ctrlobj){

  var k;

  var s = new Object();

  k=showModalDialog("/Applications_add_addsearch.jsp",s,"dialogWidth:320px;status:no;scroll:no;dialogHeight:280px");

  if (k!=null)

  {

  var url = "/applicationsAction.do?method=insertAddSeach&stId="+k[0]+"&sbId="+k[1]+"&ggId="+k[2];

  window.open(url,'newwindow', 'height=600, width=800, toolbar=no, menubar=no, scrollbars=yes, resizable=no,location=no, status=no');

  }

  }

  =========================

  依据挑选静态添加数据代码

  <script language="vbscript">

  dim lcountmx

  lcountmx = 0

  function badd(stid,stName,vcid,vcName,ggid,ggName,dwei,sliang,djia)

  lcountmx=lcountmx+1

  dim oRow,oCell,ii

  set oRow=tabzx.insertRow

  orow.id="trzx" & lcountmx

  set ocell=orow.insertcell

  dim sss

  sss="<input type=hidden name=cgdjmx"& lcountmx & " value="""">"

  sss=sss&"<input type=hidden name=stid"& lcountmx & " value=" & stid & ">"

  sss=sss&"<input type=hidden name=stName"& lcountmx & " value=" & stName & ">"

  sss=sss&"<input type=hidden name=vcid"& lcountmx & " value=" & vcid & ">"

  sss=sss&"<input type=hidden name=ggid"& lcountmx & " value=" & ggid & ">"

  sss=sss&stName

  ocell.innerhtml= sss

  ocell.classname="ListCellRow"

  set ocell=orow.insertcell

  ocell.classname="ListCellRow"

  ocell.align="center"

  ocell.width="60"

  ocell.innerhtml="<input type=hidden name=vcName" & lcountmx & " value=" & vcName & ">"& vcName

  set ocell=orow.insertcell

  ocell.classname="ListCellRow"

  ocell.align="center"

  ocell.width="60"

  ocell.innerhtml="<input type=hidden name=ggName" & lcountmx & " value=" & ggName & ">"& ggName

  set ocell=orow.insertcell

  ocell.classname="ListCellRow"

  ocell.align="center"

  ocell.width="60"

  ocell.innerhtml="<input type=text size=10 name=thao" & lcountmx & " value=''>"

  set ocell=orow.insertcell

  ocell.classname="ListCellRow"

  ocell.align="center"

  ocell.width="60"

  ocell.innerhtml="<input type=hidden name=dwei" & lcountmx & " value=" & dwei & ">"& dwei

  set ocell=orow.insertcell

  ocell.classname="ListCellRow"

  ocell.align="center"

  ocell.width="60"

  ocell.innerhtml="<input type=text size=3 name=sliang" & lcountmx & " onchange='changeFun(" & lcountmx & ")' value=''>"

  <%--

  set ocell=orow.insertcell

  ocell.classname="ListCellRow"

  ocell.align="center"

  ocell.width="60"

  ocell.innerhtml="<input type=text size=3 name=djia" & lcountmx & " onchange='changeFun1(" & lcountmx & ")' value=''>"

  --%>

  set ocell=orow.insertcell

  ocell.classname="ListCellRow"

  ocell.innerhtml="<input type='button' value='删除' onClick='vbscript:bdel(" & lcountmx & ")' id=button7 name=button7>"

  ocell.align="center"

  document.applicationsForm.ypsl.value = lcountmx

  end function

  function bdel(l)

  tabzx.deleteRow document.getElementById("trzx" & l).rowindex

  end function

  function changeFun(obj1)

  change obj1

  end function

  function changeFun1(obj1)

  change1 obj1

  end function

  </script>

  ====================

  挑选配备页面的调用代码如下

  <SCRIPT LANGUAGE=vbscript>

  '挑选多种用品并前往到主页面

  function doOk(sFlag)

  Dim StrID,m,newStrID,ii,newStrID_1

  StrID=""

  for each m in FormEdit.elements

  IF m.type="checkbox" then

  if m.checked and m.name <> "selectAllCheck" then

  if StrID = "" then

  StrID= m.value

  else

  StrID=StrID & "," & m.value

  end if

  end if

  END IF

  NEXT

  IF StrID<>"" THEN

  newStrID = Split(StrID,",")

  for ii=0 to ubound(newStrID)

  newStrID(ii) = replace(newStrID(ii),"(",",")

  newStrID_1 = Split(newStrID(ii),",")

  window.opener.badd newStrID_1(0),newStrID_1(1),newStrID_1(2),newStrID_1(3),newStrID_1(4),newStrID_1(5),newStrID_1(6),newStrID_1(7),newStrID_1(8)

  next

  if sFlag then

  window.close

  end if

  else

  msgbox "您没有挑选任何用品!" ,vbExclamation,"提示"

  exit function

  END IF

  End function

  </SCRIPT>



读库教程网文章由网络收集后整理发布,文章发布人拥有该内容的所有权力及责任!

如果你喜欢这页,可以按Ctrl+D收藏起来。

相关内容
上一个内容:ASP.NET中33个常用代码实例
下一个内容:没有了
相关评论
公益广告
精彩推荐
友情链接: 百分百青年 | 烛光信息网 | 夏布新网 | 新育互联网
管理员:QQ:27038219, E-mail:27038219@qq.com今日更新
读库教程网所有文章从网络收集所发布,文章发布人拥有该内容的所有权力及责任,转载时请注明出处!
Template designed by www.dkuu.com. Optimized for 1024x768 to Firefox,Opera and MS-IE6/IE7.