ASP.net 如何在 ascx 的程序中查找控件

//nav.ascx
<%@ Control Language="vb" AutoEventWireup="false" CodeBehind="nav.ascx.vb" Inherits="实验管理系统.nav" %>
<table id="table1" width="150" align="left" bgcolor = "#ddddbb" border="0" cellpadding="0" cellspacing="0" style="height: 350px">
<tr>
<td id="tablecell1" align ="right" valign="top">
</td>
</tr>
</table>

我希望能找到"tablecell1"这个控件并修改背景图片

加个runat=server,后台可以直接调用追问

在哪里加哦

追答

哦,我看成LABEL了。
你可以用JS来查找改变背景
document.getElementById(tablecell1).className ="className"

温馨提示:内容为网友见解,仅供参考
第1个回答  2011-03-19
aaa = (ASP.a)LoadControl("~/a.ascx");
Response.Write(((TextBox)aaa.FindControl("TEST").FindControl("TextBox1")).Text);
相似回答
大家正在搜