Jul 20, 2012, 2:39 PM
[CLOSED] Any alternative ways to perform same "ASCX" with multi instances assembling?
I code some Ext components into single ascx. And want to bind two same controls but with different data bindings. Coding like the following:
Can I have some alternative ways to "Add" same ascx control with more than one instance without worrying about ID conflict?
<ext:Panel runat="server" ID="pMain" Layout="FitLayout">
<TopBar>
<ext:Toolbar runat="server">
<Items>
<ext:Button runat="server" ID="B1" Icon="Reload" />
<ext:ToolbarSeparator runat="server" />
</Items>
</ext:Toolbar>
</TopBar>
<Items>
<ext:DataView runat="server" ItemSelector="li">
<Store>
<ext:Store runat="server" AutoLoad="false" />
</Store>
<Tpl runat="server">
<Html>
<div style="padding:10px;">
<ul>
<tpl for=".">
<li>
<a href="javascript:void(0)" onclick="{[this.instanceName]}.BeginView(ISSUtil.GUID.Normalize('{UniqueId}'))">
{Name}
</a>
</li>
</tpl>
</ul>
</div>
</Html>
</Tpl>
</ext:DataView>
</Items>
</ext:Panel>
Afore code is encapsulated into ascx file and re-assemble into Page by:Control c1 = container.Page.LoadControl(controlPath);
Control c2 = container.Page.LoadControl(controlPath);
container.ContentControls.Add(c1);
container.ContentControls.Add(c2);
Error happened for sure if two more instances inserted into ContentControls because IDs are conflicted.Can I have some alternative ways to "Add" same ascx control with more than one instance without worrying about ID conflict?
Last edited by Daniil; Jul 31, 2012 at 12:29 PM.
Reason: [CLOSED]