后台读取绑定控件中的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;
相关文章推荐
- 服务端控件绑定后台变量值无效runat="Server" <%= **** %>
- jQuery+ajax从数据库取值和和绑定前台html控件上,然后再通过ajax把值传到后台,让后台写入到数据库
- WPF 界面控件遍历和后台行为绑定写法
- c# winform项目treeview控件绑定本地电脑磁盘信息,读取文件夹信息,显示文件夹内文件内容
- WPF 如何在后台进行控件属性的绑定MVVM
- 使用反映实现前端WEB窗口控件与后台数据库类对象的动态绑定
- 我的ASPxGridView控件的数据是在后台绑定的,但是实现不了筛选和分页的功能,只能显示一页的数据?
- Demo: Dictionary>> 泛型读取XML文件数据作为数据源(DataSource)绑定到DropDownList控件 定义个一个公用类
- Jquery加载时从后台读取数据绑定到dropdownList
- ASP.NET控件(gridview datalist等等 )后台绑定数据
- WPF MVVM后台绑定没有Command属性的控件,绑定任何事件事件
- ListView控件的数据绑定与读取
- 前台repeater中循环绑定了input的text控件,怎么在后台循环遍历text的值。
- easyui-combotree传递参数到后台获取json值来绑定combotree控件
- iOS代码实现:创建按钮,绑定按钮事件,读取控件值
- asp.net ajaxtoolkit CascadingDropDown从数据库中读取数据绑定到DropDownList控件上
- 当ListView控件在后台绑定数据源时,用DataPager控件分页需要注意的问题
- 从XML文件读取数据绑定到列表控件2
- 服务器端控件text没办法绑定后台成员变量的原因解释
- 当ListView控件在后台绑定数据源时,用DataPager控件分页需要注意的问题