you should be able to, for example
<table id="mytable" runat="Server">
<tr><td>hello</td></tr>
</table>
<script language="C#" runat="server">
void Page_Load(Object o, EventArgs e)
{
mytable.Rows[0].Cells[0].Style["color"] = "red";
mytable.Rows[0].Cells[0].Attributes["hello"] = "world";
}
</script>
<table id="mytable" runat="Server">
<tr><td>hello</td></tr>
</table>
<script language="C#" runat="server">
void Page_Load(Object o, EventArgs e)
{
mytable.Rows[0].Cells[0].Style["color"] = "red";
mytable.Rows[0].Cells[0].Attributes["hello"] = "world";
}
</script>
解决方案 »
- cache 缓存中移除项时通知应用程序的方法 中httpcontext 为 null 怎么处理
- gridview的问题!
- 如何把这个div 用sb.Append显示出来,然后再上面的textbox赋值?这样可行不?
- asp.net2.0 如何连接到mysql?
- vs2005生成项目安装文件时为什么项目输出中没有“主输出”?
- 100分求解首页导航菜单怎么实现?
- 做搜索企业相关信息的搜索引擎应该用到什么技术?
- 怎么控制DataGrid的行高和设置一张图片为行的背景?
- Datalist 的一个简单问题 50分在线等
- dataGrid模板列中怎样根据某列的值显示不同内容(VB)
- 为什么我的IIS信息服务会这样子呢?
- 如何判断一个字符是不是汉字?
<tr><td>hello</td></tr>
</table>
你要想在代码中控制的话,那么加上runat=server这个属性,就可以在代码里设置cell这个属性了,如上面所说的
Table1.Rows[1].Cells[0].InnerText="谢谢五星上校和三星上尉。我的问题解决了";