您的位置:首页 > 其它

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

2013-12-24 16:11 288 查看

前台

<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" onmouseover="this.className='tableRowSelected';" onmouseout="this.className='tableRow';" height="25px">

<td align="center"><a href="#" onclick="tableBrowseRangeList.deleteRow(this.parentNode.parentNode.rowIndex);">删除</a></td>

<td>

<select name="selcCorp" id="selcCorp" runat="server" style="width:100%"

onchange="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" onmouseover="this.className='tableRowSelected';" onmouseout="this.className='tableRow';" height="25px">

<td align="center"><a href="#" onclick="tableBrowseRangeList.deleteRow(this.parentNode.parentNode.rowIndex);">删除</a></td>

<td>

<select name="selcCorp" id="selcCorp" runat="server" style="width:100%"

onchange="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;
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐