I am trying to create a reusable custom user control that contains a map and loads my standard overlays and objects without coding this in all the pages. I have various pages with essentially the same map on each page. I see there was a bug fixed in 2.0 with creating an ascx with the map in it, but when I do this I get a bunch of jscript errors on the initial page load. I tried this in the sample project and still get the errors. What am I missing?
Builiding custom user map control
David,
I didn’t recreate the issue. Please make sure there is only one “ScriptManager” in both the .aspx page and .ascx user control. In other word, please don’t use the “ScriptManager” in .aspx which uses the .ascx control that has already contains on “ScriptManager”.
The attached is a sample that works fine, please have a check if there is any difference with yours.
Thanks,
Johnny,
1776-LoadMapInAscx.zip (1.79 KB)
I only have one script manager. The attachment does not contain the following files:
MapLoader.ascx.cs
CSSamples.Samples.GettingStarted.MapLoader
CodeBehind="MapLoader.ascx.cs" Inherits="CSSamples.Samples.GettingStarted.MapLoader"
David,
Sorry that i missed something, please try the attached again, and any question please let me know.
Thanks,
Johnny,
1777-LoadMapInAscx.zip (3.25 KB)
Thanks Johnny. You were right, it was stupid mistake on my part regarding the scriptmanager. Thanks so much for your help.
David,
Very glad to hear that, any question please let us know.
Thanks,
Johnny,