asp.net - Render the same user control multiple times -
is possible render same user control (.ascx) multiple times? idea create dashboard widgets represented user controls. there can several widgets differ settings only.
mvc view:
@html.partial("reportviewerusercontrol", 1) @html.partial("reportviewerusercontrol", 2)
user control:
<%@ control language="c#" inherits="system.web.mvc.viewusercontrol<system.int32>" %> <script runat="server"> private void page_load(object sender, eventargs e){ /* */ } </script> <div> <form id="form1" runat="server"> <asp:scriptmanager id="scriptmanager1" runat="server"> </asp:scriptmanager> <rsweb:reportviewer id="reportviewer1" runat="server" asyncrendering="false"> </rsweb:reportviewer> </form> </div>
now 1 user control displayed on page , chrome's console alerts of 2 identical errors:
uncaught sys.argumenttypeexception: sys.argumenttypeexception: object of type 'sys._application' cannot converted type 'sys._application'. parameter name: instance
Comments
Post a Comment