Hey there folks, I have a user control (UCInside, e.g.) inside another user control (UCOutside). I want to call a function that's contained in UCInside from UCOutside. Since UCInside has an associated class (let's call it ClassInside), I figured I could call
the function by a simple
ClassInside.UCInside.MyFunction(params)
This calls the function, but I then can't seem to access any of web controls in UCInside from that function.
Specifically, I have a RadioButtonList defined in UCInside. I want to retrieve, and then use, the selectedValue in MyFunction. I get an 'object reference not set to instance of object' error on
strMyValue= Me.radiobuttonlist1.SelectedValue
Can I not call the function from the outside user control? Since UCInside is in UCOutside, it won't help to raise an event, right? Thanks, Rachel
rachelreese
Member
130 Points
26 Posts
ASPInsiders
User Control calling function in another user control?
Aug 06, 2003 07:18 PM|LINK