Use Page.LoadTemplate and Pass Parameters
问题 I need to load a template to an ASP.NET ListView depending on the type of an object. However, I need to pass parameters to that ItemTemplate before loading it in. The item template that gets loaded into the list view is a .ascx user control. ITemplate template = Page.LoadTemplate("~/Controls/Questions/TrueFalse.ascx"); listView.ItemTemplate = template; I've tried casting template as UserControl or as TrueFalse (the type of the user control that loads), but both cast to a null. I need to pass