手机版

jQuery生成ASP 网服务器控件的代码

时间:2021-10-24 来源:互联网 编辑:宝哥软件园 浏览:

超文本标记语言如下复制代码代码如下: tr TD class='左TD ' style='宽度: 107 px '附加金额/TD TD TD style=' width : 315 px ' ASP : textbox ID=' txtExtendMoney ' Text=' 0 ' runat=' server '/ASP : textbox ASP :正则表达式验证程序ID=' regExtend ' runat=' server ' ControlToValidate=' txtExtendMoney ' Display=' Dynamic '错误消息='格式不正确验证表达式='[1-9]\ d * \ .\d*|0\ .\d*[1-9]\d*|^[1-9]\d*|0'/asp:regularexpressionvalidator ASP : requiredfieldvalidator id=' requeext no ' runat=' server ' control to validate=' txtextendmony ' display=' dynamic '错误消息='不可为空/asp: requiredfieldvalidator/TD TD class='左TD '结算方式/TD tdasp : dropdownlist ID=' ddlPayType ' runat=' server ' ASP : listitem现金/asp: istitemasp : istitem银行转账/ASP 3360 listitem/ASP 3360 dropdownlist/TD/tr tr TD class='左TD '结算账户/TD TD colspan=' 3 ' asp:单选按钮列表ID=' rdbPayAccountBank ' runat=' server ' RepeatLayout=' Flow '/ASP :单选按钮列表/TD/tr最后一个单选按钮列表的列表项为"其他账户,当选中时,其后增加相应的ASP。网服务器控件。选择其它时移除该控件

增加

引入jQuery,然后如下代码复制代码代码如下: /*结算方式*/$(':radio:last ').bind('click ',function(){ if($('#txtBankNew ')).长度==0){ $(this).父项()。追加(' span id=' span '标签样式=' margin-left :6 px;'右边距' :4 px'for='txtBankNew '开户银行/labelinput runat=' server ' id=' TxtBankNew ' type=' text '/label style=' margin-left :6 px;'右边距:4 pxfor='txtAccountNew '开户账户/labelinput type=' text ' id=' TxTaccountNew ' runat=' server '/span ');};$('#txtBankNew ').焦点()。select();});$(' :广播:不是(:最后)').bind('click ',function(){ if($(' # TxtBankNew ')。长度0){ $(' # span ').移除();} });这里值得注意的是如果附加之后的控件为服务器控件,也就是有runat='服务器'属性的,原先的单引号生成源后会自动变成双引号,并且runat='服务器'消失。这实际上跟手工在前台书写此数字正射影像图结构网络.框架处理一致。因此打开此页面源文件可以看到如下

但不幸的是,该服务器控件依然没有起作用…… 还是用隐藏服务器控件来解决吧!

版权声明:jQuery生成ASP 网服务器控件的代码是由宝哥软件园云端程序自动收集整理而来。如果本文侵犯了你的权益,请联系本站底部QQ或者邮箱删除。