public string ExecutCore(string basePath, string virtualPath, WebPageBase page)
{
var sb = new StringBuilder();
using (var tw = new StringWriter(sb))
{
var context = new HttpContextWrapper(CreateContext(basePath, virtualPath, tw));
var pageContext = new WebPageContext(context, page, null);
page.PushContext(pageContext, tw);
page.Execute();
page.PopContext();
}
return sb.ToString();
}