Last post Jul 21, 2008 01:24 PM by Peter Bucher
Mar 06, 2008 05:15 AM|Netsu|LINK
Hi, I'm having a strange problem - I have a usercontrol which only shows data (no editing involved) and inside it another usercontrol which is supposed to get a certain value from the first one.
Everything was working fine until I moved to asp.net 2.0 and tried to connect it to objectdatasource. Here is the relevant code:
Partial Class ascx_main_pages_standard_index_item
Private _article As Integer
Public Property article() As Integer
Set(ByVal value As Integer)
_article = value
textbox1.text = value
AudioBox1.article = value
The first usercontrol works just fine except for firing the second one (audiobox1)
I also tried to use
Which doesn't work either. What am i doing wrong???
Mar 08, 2008 06:49 PM|Peter Bucher|LINK
Where is "AudioBox1" placed in?
Compare the executing cycle of your get- or set accessors.
I bet its an lifecycle problem.
Mar 09, 2008 09:57 AM|Netsu|LINK
Thanks for replying
AudioBox1 is an instance to another userControl (in another .ascx file)
I assume you are right because the value which is passed to the audiobox control is 0 (zero), so it must be a lifecycle issue. but as i said, on asp.net 1.1 it worked OK... and also, the other controls (like textbox1) work just fine, which means that the
value of the property "article" is set.
thanks again for any help...
Mar 10, 2008 05:55 AM|Peter Bucher|LINK
Go on with debugging and tracing, that will solve your lifecycle problem.
Mar 12, 2008 07:27 AM|Netsu|LINK
Hi Peter, thanks for your help
I did some debugging and it was indeed a problem of life cycle, so i solved that one, but the problem continues - in my usercontrol i have an sqldatasource which i want to bind to a repeater according to the property which is passed to the usercontrol.
this is the code i use:
_article = value
this is where the problem is - the sqldatasource doesnt work. if i change _article to some number like 892 it works fine (binds to the row that has id of 892)
when i put a breakpoint i can see that value of the parameter works fine - _article has the correct value according to my table. so why is the sqldatasource not binding??
Jul 21, 2008 01:24 PM|Peter Bucher|LINK
You set the Breakpoint at the "e.Command...."-Line?