473,396 Members | 1,724 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

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 2522
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Matthew | last post by:
hi dear members, i have derived my aspx code behind class from a 'BasePage'.in this BasePage, i put some formatting functions in it. I also write some customer controls, in one control, i have to...
2
by: Novice | last post by:
I can't seem to get my Custom WebControl to output a button whose click event is associated with a particular method. Here is the code I have right now that contains a panel and there is a...
12
by: Jim Hammond | last post by:
I am passing the whole object instead or parameters in my select and update methods. I can get the updated object if I set UpdateMethod, let ASP.NET autogenerate an update button, and then press...
3
by: J'son | last post by:
Guys, I have created a custom class that derives from DataList so that I can add some custom client side functionality into each new item row (<td>). Heres the class in its simplest form: ...
10
by: J055 | last post by:
Hi I've been trying out SqlCacheDependency using the ObjectDataSource and SQL Server 2005. It all works quite well with the minimum of configuration, e.g. <asp:ObjectDataSource...
2
by: Olivier Matrot | last post by:
Hello, I'm using a gridview with objectdatasource and custom objects collections SELECT/INSERT/UPDATE/DELETE methods are using custom objects as parameters. This is working fine. But I have a...
2
by: Manjunath | last post by:
HI, How to catch custom exception using ObjectDataSource Control. I am calling Business Layer method through ObjectDataSource control, when Business layer method throws exception which will be...
2
by: J055 | last post by:
Hi I have a method with the following signature: public bool UpdateSetAccounts(int items) { } How do I pass a collection of selected values in a ListBox to this ObjectDataSource...
1
by: Max2006 | last post by:
Hi, I am truing to find a pattern for my Business Logic Layer to be able to work fine win ObjectDataSource's Update method. The challenge is ObjectDataSource is not able to work with an...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.