后台读取绑定控件中的TextBox值

前台

<table class="tableBorder" border="0" cellpadding="0" cellspacing="0" id="tableBrowseRangeList" width="100%" >
                            <tr class="tableHeader" height="25px">
                                <th align="center">删除</th>
                                <th align="center">负责公司</th>
                                <th align="center">负责人</th>
                            </tr>
                            <asp:Repeater runat="server" ID="repeater1">
                                <ItemTemplate>
                                    <tr class="tableRow" οnmοuseοver="this.className='tableRowSelected';" οnmοuseοut="this.className='tableRow';" height="25px">
                                        <td align="center"><a href="#" οnclick="tableBrowseRangeList.deleteRow(this.parentNode.parentNode.rowIndex);">删除</a></td>
                                        <td>
                                            <select name="selcCorp" id="selcCorp" runat="server" style="width:100%"
                                                    οnchange="showUserList(this.value, this.parentNode.parentNode.rowIndex)"></select>
                                            <asp:Literal ID="LiteralCorpId" Visible="false" runat="server" Text='<%#Eval("user_corp_id") %>'></asp:Literal>
                                            <asp:Literal ID="LiteralUserId" Visible="false" runat="server" Text='<%#Eval("user_id") %>'></asp:Literal>
                                        </td>
                                        <td><select name="selectMan" id="selectMan" runat="server" style="width:100%" ><option>--</option></select></td>
                                    </tr>
                                </ItemTemplate>
                            </asp:Repeater>
                            <tr class="tableRow" οnmοuseοver="this.className='tableRowSelected';" οnmοuseοut="this.className='tableRow';" height="25px">
                                <td align="center"><a href="#" οnclick="tableBrowseRangeList.deleteRow(this.parentNode.parentNode.rowIndex);">删除</a></td>
                                <td>
                                    <select name="selcCorp" id="selcCorp" runat="server" style="width:100%"
                                            οnchange="showUserList(this.value, this.parentNode.parentNode.rowIndex)"></select>
                                    <asp:Literal ID="LiteralCorpId" Visible="false" runat="server" Text='<%#Eval("user_corp_id") %>'></asp:Literal>
                                    <asp:Literal ID="LiteralUserId" Visible="false" runat="server" Text='<%#Eval("user_id") %>'></asp:Literal>
                                </td>
                                <td><select name="selectMan" id="selectMan" runat="server" style="width:100%" ><option>--</option></select></td>
                            </tr>            
                        </table>

js脚本读取值后拼接并放到隐藏域中(拼接格式1,1;1,2)

function addButtonDuty() {
            var strSql="";
            for(var i=1;i<tableBrowseRangeList.rows.length;i++){
                if(tableBrowseRangeList.rows[i].cells[1].childNodes[0].value!="--" && tableBrowseRangeList.rows[i].cells[2].childNodes[0].value!="--" ){
                    strSql += tableBrowseRangeList.rows[i].cells[1].childNodes[0].value + "," ;
                    strSql += tableBrowseRangeList.rows[i].cells[2].childNodes[0].value;
                    strSql += ";";
                }
            }
            if(strSql!=""){
                strSql = strSql.substring(0,strSql.length-1);
            }
            document.all.hideLabel2.value=strSql;

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值