用Repeater呈现数据,首列HtmlSelect可选,想是想的功能就是选择HtmlSelect之后,本行数据做相应的改变不想通过后台遍历Repeater行Item的方式做,请问可否直接传递HtmlSelect控件到C#端进行相应处理?希望大家不吝赐教,谢谢!
解决方案 »
- [asp.net 读写Excel的问题]页面操作死掉的问题
- DataList中SelectedIndexChanged方法的问题?
- 紧急求助,数据库被黑!
- 超强的正则表达式
- 请高手帮忙改一下返回参数的存储过程,谢谢先!
- 大家帮我出个主意吧:这个参数该怎么传递?分不够再加,想要多少都给,因为我实在是郁闷!!
- 提取页面指定内容连接-
- 显示同时在线的具体用户的程序怎么写?(高手请进!)
- 域中OU的遍历
- 我在asp.net中没有启用客户端缓存,单为什么有的客户端会缓存页面?
- oracle数据库和IIS7安装在同一台机器上,asp.net mvc web项目部署有什么要求?
- 紧急求助,删了文章怎么一起删掉它所用的图片
{
int num = 0;
if (e.Item.ItemType == ListItemType.Header)//表头输出
{
string strHeader = "<table width=\"100%\" cellspacing=\"0\" style=\" word-break:break-all;\"><tr style=\"width:100%\">"; strHeader += "<td style=\"width:15%; text-align:center;\">下拉测试</td>"; foreach (DataColumn dc in this.TestDT().Columns)
{
strHeader += "<td style=\"width:15%; text-align:center;\">" + dc.ColumnName + "</td>";
}
strHeader += "</tr></table>"; Literal liteHeader = e.Item.FindControl("lite_Header") as Literal;
if (liteHeader != null)
{
liteHeader.Text = strHeader;
}
}
else if (e.Item.ItemType == ListItemType.Item)//表体输出
{
string strItem = "<table width=\"100%\" cellspacing=\"0\" style=\" word-break:break-all;\">"; foreach (DataRow dr in this.TestDT().Rows)
{
strItem += "<tr style=\"width:100%\">"; strItem += "<td style=\"width:15%; text-align:center;\">";
strItem += "<select id=\"sel"+num.ToString()+"\" onchange=\"ajaxChange(this);\" class='colorblur' onfocus=" + "this.className='colorfocus';" + " onblur=" + "this.className='colorblur';" + " runat='server'>";
foreach (DataRow row in this.TestDT().Rows)
{
strItem += "<option value='" + row["Name"].ToString() + "'>" + row["Name"].ToString() + "</option>";
}
strItem += "</select></td>";
foreach (DataColumn dc in this.TestDT().Columns)
{
//strItem += "<td style=\"width:15%; text-align:center;\"><asp:TextBox ID=\"" + dc.ColumnName + "\" Text='" + dr[dc.ColumnName].ToString() + "' runat=\"server\" Width=\"80px\" class=\"colorblur\" onfocus=\"this.className='colorfocus';\" onblur=\"this.className='colorblur';\"></asp:TextBox></td>";
strItem += "<td style=\"width:15%; text-align:center;\">";
strItem += "<input id=\"" + dc.ColumnName+num.ToString() + "\" value=\"" + dr[dc.ColumnName].ToString() + "\" class='colorblur' onfocus=" + "this.className='colorfocus';" + " onblur=" + "this.className='colorblur';" + " type='text' runat='server' /></td>";
//strItem += "<td style=\"width:15%; text-align:center;\">" + dr[dc.ColumnName].ToString() + "</td>";
}
strItem += "</tr>";
num++;
}
strItem += "</table>"; Literal liteItem = e.Item.FindControl("lite_Item") as Literal;
if (liteItem != null)
{
if (cnt == 0)
{
liteItem.Text = strItem;
}
cnt++;
}
}