Is it possible to render the same User Control (.ASCX) multiple times? The idea is to create dashboard with widgets that are represented as User Controls. There can be several Widgets that differ with their 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 only one user control is displayed on the page and Chrome's console alerts of 2 identical errors:
Uncaught Sys.ArgumentTypeException: Sys.ArgumentTypeException: Object of type 'Sys._Application' cannot be converted to type 'Sys._Application'.
Parameter name: instance