0
我试图在仪表板上放置多个用户控件。但只有一个用户控件可见。在表格中添加多个用户控件
Dashboard.aspx:
<table cellpadding="0" cellspacing="0" border="0" width="220px">
<tr>
<td>
<dc:MyControl ID="c1" runat="server"/>
</td>
<td>
<dc:MyControl ID="c2" runat="server"/>
</td>
</tr>
</table>
它看起来像在用户控件创建的全局对象将覆盖另一个。
然后我改变了我的javascript代码:
MyControl.ascx:
//Display gauge on the page (has some html5 elements like canvas)
<div id="gauge1" class="gauge"></div>
<script type="text/javascript">
var <%=this.ClientID%>global = new jGauge(); // Create a new gauge.
<%=this.ClientID%>global.id = 'gauge1'; // Link the new gauge to the placeholder DIV.
// This function is called by jQuery once the page has finished loading.
$(document).ready(function() {
<%=this.ClientID%>global.init(); // Put the gauge on the page by initializing it.
});
</script>
但仍然只有一个用户控件可见。有什么建议么?
感谢您的时间。那么我尝试过,但仍然没有成功。我只是不知道有什么缺失... – benjamin54
@ benjamin54我不知道;在这一点上,我会检查Firebug的任何Javascript错误/跟踪代码。 – McGarnagle