Hi everyone
I am trying to create a .net web application, and I am having trouble
with an aspect of using user controls...
I want to be able to create a generic method of calling a number of
user controls, based on a variable that is passed to a parent form..
the folling is an excerpt of my code
ReportName = Request.QueryString["name"];
ReportPath = ReportName+".ascx";
Cert.Forms.InterfaceReport CReport;
CReport = (Cert.Forms.InterfaceReport) LoadControl(ReportPath);
CReport.LoadRequestData(Request);
divContainer.Controls.Add(CReport);
where the report class name is passed to the form in the Request
object, and is retrieved using the QueryString method. i then pass
some other Request information to the user control class instance that
is opened. doing some testing has revealed that the 2nd line of code
is working correctly. the problem comes however, when i try to add
the user control to a panel (called divContainer) on the parent form.
the error i am getting is shown below..
Argument '1': cannot convert from 'Cert.Forms.InterfaceReport' to
'System.Web.UI.Control'
If anyone has any ideas, they would be greatly appreciated....