hi!
I'm trying to create an ESRI web map control dynamically on a WebPart using C# and VS 2005.
When using it on a regular aspx file it works good - I create it, initialize it, and then add it to the page
with the - Form.Controls.Add(MyWebMapControl);
I added it with the "Form.Controls.Add()" and Not with just "Controls.Add()" because that with "Controls.Add()" I get an error that tells me that the webMapControl should be placed inside a form tag.
anyway I took the code ,copied it and paste it to my webpart, everything went good exept that there isn't any "Form" Data member when inheriting from webpart.
So I tried Page.Form.Controls.Add() but I got this Error :
"The control collection cannot be modified during DataBind, Init, Load, PreRender or Unload phases"
I tried to add the webMapControl to the webPart with the "Controls.Add()" but it gave me an unspecified error and I know that it's becuse that With Only "Controls.Add" it puts the WebMapControl rendered html outside a form tag.
How can I access the Form property of the WebPart without getting an Error ,or any other way to add my control to the page..
thank's
Itai