Welcome Guest Search | Active Topics | Sign In | Register

User Control inside of a Dialog Options
Heidi
Posted: Thursday, June 28, 2007 8:29:49 AM
Rank: Newbie
Groups: Member

Joined: 6/28/2007
Posts: 6
Hi,

I'm using the Dialog to load a User Control. I read an earlier post to find out how to load the user control without setting the ShowButton property. Which I needed, and that's working correctly!! But now, in the Button Click event I need to set some values, and then call the method in the User Control to load the data from the database based on the button that the user clicked. (I'm using the Ajax Reorder List to display my data, and inside of that is where the user will click the button) But I'm not sure how to do that since it's inside of the Dialog. When I try to use name of the user control and call the method like:
Code: C#
UserControl.MethodName(variable1, variable2);

I get an error saying that "UserControl" does not exist in the current context. I saw a post about how to find the control, but it's not like a label where I need to set a defined property. Any help would be great!

Thanks!
eo_support
Posted: Thursday, June 28, 2007 9:03:49 AM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,098
Hi Heidi,

The user control is not a direct member of the page so you won't be able to access it that way. You will need to use this property to "find" it first:

http://www.essentialobjects.com/ViewDoc.aspx?t=EO.Web.Dialog.ContentContainer.html

Code: C#
YourUserControlType userControl = (YourUserControlType)
    Dialog1.ContentContainer.FindControl("your_user_control_id");
userControl.your_method();


Thanks


You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.