Intrinsic method raises an error

I am creating a web app that embeds a control group on a page if the item being displayed has options. The control group is located on a container control called ‘OPT’, but when I call the embedwithin method in the Open event I get a ‘this item does not exist’ error. The offending line of code is opt.EmbedWithin(self,200,200,300,300). I have tried placing the code in the ‘shown’ event, but still get the same result. ‘opt’ is a web container control and all of the locations and sizes are within the bounds of the parent web page. Embedwithin method seems to be the issue, but it is listed on the webcontrol’s lister.

You have to create an instance of “opt” first.

Dim curOpt as New Opt curOpt.EmbedWithin(self,200,200,300,300)