Users Pricing

forum

Home Forums Adding multiple user controls in table – MindStick

Adding multiple user controls in table

Anonymous User 1764 21 Aug 2014

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?


1 Answers

Sumit Kesarwani 21 Aug 2014 Accepted Answer
Markdown for AI

A clean, structured version of this page for AI assistants and LLMs.

Open .md