I'm trying to put multiple user controls on the dashboard. But only one user control is visible.
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>
It looked like the global object created in user control overwrites the other one.
I then changed my javascript code as:
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>
But still only one user control is visible. Any suggestions?
Sumit Kesarwani
21-Aug-2014<table cellpadding="0" cellspacing="0" border="0" width="100%">
<tr>
<td style="width:50%;">
<dc:MyControl ID="c1" runat="server"/>
</td>
<td style="width:50%;">
<dc:MyControl ID="c2" runat="server"/>
</td>
</tr>