K
Keith Patrick
Maybe my expectations are just too low because I haven't read much
documentation on this method, but basically, I am trying to load a user
control dynamically without using a virtual path (I have disabled
FileIOPermission beyond AllLocalFiles, and it appears that
LoadControl(string) calls Server.MapPath, which needs greater access). What
I am attempting to do is just pass in my UC type:
Control ctrl = this.Page.LoadControl(TestApp.Controls.MyUserControl, null);
but when I do this, the control doesn't show up. I've looked at the
differences between controls loaded this way and via virtual path, as the
virtual path version displays just fine. The underlying types, however are
different. The virtualpath one is of type "ASP.MyUserControl_aspx" whereas
the one loaded from type is TestApp.Controls.MyUserControl and also lacks
TemplateXXXX properties. Am I somehow misuing LoadControl(type, object[])
or is there a bug that prevents dynamic control loading like this?
documentation on this method, but basically, I am trying to load a user
control dynamically without using a virtual path (I have disabled
FileIOPermission beyond AllLocalFiles, and it appears that
LoadControl(string) calls Server.MapPath, which needs greater access). What
I am attempting to do is just pass in my UC type:
Control ctrl = this.Page.LoadControl(TestApp.Controls.MyUserControl, null);
but when I do this, the control doesn't show up. I've looked at the
differences between controls loaded this way and via virtual path, as the
virtual path version displays just fine. The underlying types, however are
different. The virtualpath one is of type "ASP.MyUserControl_aspx" whereas
the one loaded from type is TestApp.Controls.MyUserControl and also lacks
TemplateXXXX properties. Am I somehow misuing LoadControl(type, object[])
or is there a bug that prevents dynamic control loading like this?