J
Jason
I am trying to dynamically add a web user control - ctrlBlogEntry.ascx
- to a page - default.aspx - (via an ASPlaceHolder).
I was able to get it to work with the following:
controls_ctrlBlogEntry ctrlBE =
(controls_ctrlBlogEntry)LoadControl("/blog/controls/ctrlBlogEntry.ascx");
However, I starting experiencing problems with every other compile - it
started failing with the following error:
System.InvalidCastException: Unable to cast object of type
'ASP.controls_ctrlblogentry_ascx' to type 'controls_ctrlBlogEntry'.
I have also tried the following variations, but to no avail:
controls_ctrlBlogEntry ctrlBE =
(ASP.controls_ctrlblogentry_ascx)LoadControl("/blog/controls/ctrlBlogEntry.ascx");
ASP.controls_ctrlblogentry_ascx ctrlBE =
(ASP.controls_ctrlblogentry_ascx)LoadControl("/blog/controls/ctrlBlogEntry.ascx");
It has now started failing every time, but I can't figure out what's
going on.
Can someone see what I'm doing wrong?
Thanks!
- to a page - default.aspx - (via an ASPlaceHolder).
I was able to get it to work with the following:
controls_ctrlBlogEntry ctrlBE =
(controls_ctrlBlogEntry)LoadControl("/blog/controls/ctrlBlogEntry.ascx");
However, I starting experiencing problems with every other compile - it
started failing with the following error:
System.InvalidCastException: Unable to cast object of type
'ASP.controls_ctrlblogentry_ascx' to type 'controls_ctrlBlogEntry'.
I have also tried the following variations, but to no avail:
controls_ctrlBlogEntry ctrlBE =
(ASP.controls_ctrlblogentry_ascx)LoadControl("/blog/controls/ctrlBlogEntry.ascx");
ASP.controls_ctrlblogentry_ascx ctrlBE =
(ASP.controls_ctrlblogentry_ascx)LoadControl("/blog/controls/ctrlBlogEntry.ascx");
It has now started failing every time, but I can't figure out what's
going on.
Can someone see what I'm doing wrong?
Thanks!