468,257 Members | 1,429 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,257 developers. It's quick & easy.

Problem with ObjectDataSource and custom webcontrol.

Okay, I something weird is happening where I do not know if I am doing
something wrong.

I have a page that contains a custom webcontrol that I developed. This
webcontrol basically loads a UserControl (ascx) using the LoadControl method
and writing it out to the browser.

Page --> custom webcontrol --> usercontrol (via LoadControl) --> stream to
browser.

On the usercontrol, I am using an ObjectDataSource where I have some methods
and objects that this datasource uses. When I view the page based on the
above scenario nothing appears.

However, when I take the above usercontrol and place it directly on a page.
The contents renders fine. My "select" method is being invoked and
everything.

The only difference between the two ways is that the first way uses a
webcontrol as an intermediary which dynamically loads the usercontrol.
Would that cause problems with the use of the ObjectDataSource?

Apr 16 '06 #1
2 2381
Actually, it might just be a general problem with the LoadControl method.
It does not appear that any code is executing. I cannot debug into the
usercontrol and even if I throw an exception in the Page_Load, nothing
happens. Any ideas?

"Peter Rilling" <pe***@nospam.rilling.net> wrote in message
news:Ot**************@TK2MSFTNGP04.phx.gbl...
Okay, I something weird is happening where I do not know if I am doing
something wrong.

I have a page that contains a custom webcontrol that I developed. This
webcontrol basically loads a UserControl (ascx) using the LoadControl
method and writing it out to the browser.

Page --> custom webcontrol --> usercontrol (via LoadControl) --> stream to
browser.

On the usercontrol, I am using an ObjectDataSource where I have some
methods and objects that this datasource uses. When I view the page based
on the above scenario nothing appears.

However, when I take the above usercontrol and place it directly on a
page. The contents renders fine. My "select" method is being invoked and
everything.

The only difference between the two ways is that the first way uses a
webcontrol as an intermediary which dynamically loads the usercontrol.
Would that cause problems with the use of the ObjectDataSource?

Apr 16 '06 #2
Nevermind, turns out I was not adding it to the Controls collection.

Doh!

"Peter Rilling" <pe***@nospam.rilling.net> wrote in message
news:Ot**************@TK2MSFTNGP04.phx.gbl...
Okay, I something weird is happening where I do not know if I am doing
something wrong.

I have a page that contains a custom webcontrol that I developed. This
webcontrol basically loads a UserControl (ascx) using the LoadControl
method and writing it out to the browser.

Page --> custom webcontrol --> usercontrol (via LoadControl) --> stream to
browser.

On the usercontrol, I am using an ObjectDataSource where I have some
methods and objects that this datasource uses. When I view the page based
on the above scenario nothing appears.

However, when I take the above usercontrol and place it directly on a
page. The contents renders fine. My "select" method is being invoked and
everything.

The only difference between the two ways is that the first way uses a
webcontrol as an intermediary which dynamically loads the usercontrol.
Would that cause problems with the use of the ObjectDataSource?

Apr 16 '06 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

4 posts views Thread by Matthew | last post: by
3 posts views Thread by J'son | last post: by
10 posts views Thread by J055 | last post: by
2 posts views Thread by Manjunath | last post: by
reply views Thread by NPC403 | last post: by
reply views Thread by kermitthefrogpy | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.