Hi, I want a web service to load an .ascx control, load some values in it and then return the HTML content of this control. I have something like that:
[WebMethod(EnableSession = true)]
public void GetHTML()
{
UserControl loader = new UserControl();
MyCustomReport reportControl =
(MyCustomReport)loader.LoadControl("~/The/path/to/the/.ascx");
reportControl.DataBind();
return "TODO";
}
MyCustomReport overrides DataBind()
:
public override void DataBind()
{
base.DataBind();
// etc.
}
The row base.DataBind()
throws a NullReferenceException
and the debugger says:
Use of keyword 'base' is not valid in this context
Any help will be appreciated, thanks!