ASP.NET/C# - Dependency Injection (Unity) and Server.Execute - dependencies are not injected -
i'm trying execute page in project i'm working on using server.execute (i need exact html response store on server in file, run same user context).
// small test case protected void btnexport_click(object sender, eventargs e) { system.io.textwriter twrite = new system.io.stringwriter(); server.execute("../mcc/default.aspx", twrite, true); lbl1.text = twrite.tostring(); }
however, if try run of our pages use dependency injection, dependencies not injected, , nullreferenceexceptions result.
// these "null" - should have been injected [dependency] public iradgridsettingmanager radgridsettingmanager { get; set; } [dependency] public imccmanager mccmanager { get; set; } [dependency] public imccitemmanager mccitemmanager { get; set; }
how can make sure these dependencies loaded in run-time? (i'm guessing need change in page load force injection when has not been done automatically (is null); have no idea how go doing this)
Comments
Post a Comment