<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
  <meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
I can't guess what you are trying to achieve with the code.<br>
MaestroAPI is not the only way, you can use the native API like you do,
<br>
but you have to handle all the quirks yourself, which is not a trivial
task.<br>
<br>
This line is not valid C#:<br>
<font color="black" face="Courier New" size="2"><span
 style="font-size: 10pt; font-family: &quot;Courier New&quot;;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
MgResourceIdentifier webLayoutId = new MgResourceIdentifier("Library://
Samples/
<st1:City w:st="on"><st1:place w:st="on">Sheboygan</st1:place></st1:City>
/Layouts\BasicLayout.WebLayout");<br>
</span></font><font color="black" size="2"><span
 style="font-size: 10pt; font-family: &quot;Courier New&quot;;"><br>
\B is not a valid string escape sequence, and there seems to be some
spaces, which may come from the mail program.<br>
</span></font><br>
<font color="black" size="2"><span
 style="font-size: 10pt; font-family: &quot;Courier New&quot;;">I think you can
get a better understanding of the MaestroAPI from these two examples:<br>
<a class="moz-txt-link-freetext" href="http://trac.osgeo.org/mapguide/wiki/maestro/MaestroAPI/samples/AddInitialLayer">http://trac.osgeo.org/mapguide/wiki/maestro/MaestroAPI/samples/AddInitialLayer</a><br>
<a class="moz-txt-link-freetext" href="http://trac.osgeo.org/mapguide/wiki/maestro/MaestroAPI/samples/CustomizedZoomWithWebLayout">http://trac.osgeo.org/mapguide/wiki/maestro/MaestroAPI/samples/CustomizedZoomWithWebLayout</a><br>
</span></font>
<pre><font color="black" size="2"><span
 style="font-size: 10pt; font-family: &quot;Courier New&quot;;"></span></font></pre>
<font color="black" size="2"><span
 style="font-size: 10pt; font-family: &quot;Courier New&quot;;"><br>
<br>
This piece of code seems to ovewrite the runtime map, with the
Sheboygan:<br>
</span></font>
<p class="MsoNormal" style=""><font color="black" face="Courier New"
 size="2"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
MgMap map = new MgMap();<o:p></o:p></span></font></p>
<p class="MsoNormal" style=""><font color="black" face="Courier New"
 size="2"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
MgResourceIdentifier resId = new<o:p></o:p></span></font></p>
<p class="MsoNormal" style=""><font color="black" face="Courier New"
 size="2"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
MgResourceIdentifier("Library://Samples/Sheboygan/Maps/Sheboygan.MapDefinition");<o:p></o:p></span></font></p>
<p class="MsoNormal" style=""><font color="black" face="Courier New"
 size="2"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
String mapName = resId.GetName();<o:p></o:p></span></font></p>
<p class="MsoNormal" style=""><font color="black" face="Courier New"
 size="2"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
map.Create(resourceSrvc, resId, mapName);<o:p></o:p></span></font></p>
<p class="MsoNormal" style=""><font color="black" face="Courier New"
 size="2"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
MgResourceIdentifier mapStateId = new MgResourceIdentifier("Session:"
+ sessionId + "//" + mapName + "." + MgResourceType.Map);<o:p></o:p></span></font></p>
<p class="MsoNormal" style=""><font color="black" face="Courier New"
 size="2"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
map.Save(resourceSrvc, mapStateId);<o:p></o:p></span></font></p>
<font color="black" face="Courier New" size="2"><span
 style="font-size: 10pt; font-family: &quot;Courier New&quot;;"></span></font><br>
This code seems to set the startup map in the library weblayout to the
sheboygan map:<br>
<p class="MsoNormal" style=""><font color="black" face="Courier New"
 size="2"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
MgResourceIdentifier webLayoutId = new MgResourceIdentifier("Library://
Samples/
<st1:City w:st="on"><st1:place w:st="on">Sheboygan</st1:place></st1:City>
/Layouts\BasicLayout.WebLayout");<o:p></o:p></span></font></p>
<p class="MsoNormal" style=""><font color="black" face="Courier New"
 size="2"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
MgByteReader byteReader =
resourceSrvc.GetResourceContent(webLayoutId);&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<o:p></o:p></span></font></p>
<p class="MsoNormal" style=""><font color="black" face="Courier New"
 size="2"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
XmlDocument doc = new XmlDocument();<o:p></o:p></span></font></p>
<p class="MsoNormal" style=""><font color="black" face="Courier New"
 size="2"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
String xmlLayoutDef =
byteReader.ToString();&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <o:p></o:p></span></font></p>
<p class="MsoNormal" style=""><font color="black" face="Courier New"
 size="2"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
doc.LoadXml(xmlLayoutDef);<o:p></o:p></span></font></p>
<p class="MsoNormal" style=""><font color="black" face="Courier New"
 size="2"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
XmlNode parentNode = doc.GetElementsByTagName("ResourceId").Item(0);<o:p></o:p></span></font></p>
<p class="MsoNormal" style=""><font color="black" face="Courier New"
 size="2"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
if (parentNode != null)<o:p></o:p></span></font></p>
<p class="MsoNormal" style=""><font color="black" face="Courier New"
 size="2"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
{<o:p></o:p></span></font></p>
<p class="MsoNormal" style=""><font color="black" face="Courier New"
 size="2"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
XmlNode mapRessource =
doc.SelectSingleNode("/WebLayout/Map/ResourceId");<o:p></o:p></span></font></p>
<p class="MsoNormal" style=""><font color="black" face="Courier New"
 size="2"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
if (mapRessource != null)<o:p></o:p></span></font></p>
<p class="MsoNormal" style=""><font color="black" face="Courier New"
 size="2"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
{<o:p></o:p></span></font></p>
<p class="MsoNormal" style=""><font color="black" face="Courier New"
 size="2"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
mapRessource.InnerText = "Library://Samples/Sheboygan/" +
"Maps/Sheboygan"
+
".MapDefinition";&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<o:p></o:p></span></font></p>
<p class="MsoNormal" style=""><font color="black" face="Courier New"
 size="2"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
String string1= doc.DocumentElement.OuterXml;<o:p></o:p></span></font></p>
<p class="MsoNormal" style=""><font color="black" face="Courier New"
 size="2"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
resourceSrvc.SetResource(webLayoutId, new MgByteReader(string1,
"text/xml"),
null);&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<o:p></o:p></span></font></p>
<p class="MsoNormal" style=""><font color="black" face="Courier New"
 size="2"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
}<o:p></o:p></span></font></p>
<p class="MsoNormal"><font color="black" face="Courier New" size="2"><span
 style="font-size: 10pt; font-family: &quot;Courier New&quot;;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
}&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></font><font face="Courier New" size="2"><span
 style="font-size: 10pt; font-family: &quot;Courier New&quot;;"><o:p></o:p></span></font></p>
<font color="black" face="Courier New" size="2"><span
 style="font-size: 10pt; font-family: &quot;Courier New&quot;;"><o:p></o:p></span></font><br>
<font color="black" size="2"><span
 style="font-size: 10pt; font-family: &quot;Courier New&quot;;">You cannot
overwrite the runtime map, because the AJAX viewer always overwrites the<br>
runtime map at startup, so the first segment of code has no effect.<br>
The last part seems correct, but the exception states that the xml is
broken in some way.<br>
I have seen others complain about the same problem, but I don't know
what happens.<br>
It seems that the SetResource or MgByteReader breaks the data in some
way.<br>
<br>
<br>
</span></font><font color="black" face="Courier New" size="2"><span
 style="font-size: 10pt; font-family: &quot;Courier New&quot;;"></span></font><br>
<pre class="moz-signature" cols="72">Regards, Kenneth Skovhede, GEOGRAF A/S
</pre>
<br>
<br>
<a class="moz-txt-link-abbreviated" href="mailto:ravinder.singh@BIRLASOFT.COM">ravinder.singh@BIRLASOFT.COM</a> skrev:
<blockquote
 cite="mid:176511108BBB7842992F0BF7B56EB6180658E341@INNOIDA.BIRLASOFT.COM"
 type="cite">
  <meta http-equiv="Content-Type" content="text/html; ">
  <meta name="Generator" content="Microsoft Word 11 (filtered medium)">
<!--[if !mso]>
<style>
v\:* {behavior:url(#default#VML);}
o\:* {behavior:url(#default#VML);}
w\:* {behavior:url(#default#VML);}
.shape {behavior:url(#default#VML);}
</style>
<![endif]--><o:SmartTagType
 namespaceuri="urn:schemas-microsoft-com:office:smarttags" name="City">
  <o:SmartTagType
 namespaceuri="urn:schemas-microsoft-com:office:smarttags" name="place"><!--[if !mso]>
<style>
st1\:*{behavior:url(#default#ieooui) }
</style>
<![endif]-->
  <style>
<!--
 /* Font Definitions */
 @font-face
        {font-family:Mangal;
        panose-1:0 0 4 0 0 0 0 0 0 0;}
@font-face
        {font-family:Tahoma;
        panose-1:2 11 6 4 3 5 4 4 2 4;}
@font-face
        {font-family:"Book Antiqua";
        panose-1:2 4 6 2 5 3 5 3 3 4;}
 /* Style Definitions */
 p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman";
        color:black;}
a:link, span.MsoHyperlink
        {color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {color:purple;
        text-decoration:underline;}
pre
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:10.0pt;
        font-family:"Courier New";
        color:black;}
span.EmailStyle18
        {mso-style-type:personal;
        font-family:"Book Antiqua";
        color:windowtext;
        font-weight:normal;
        font-style:normal;
        text-decoration:none none;}
span.EmailStyle19
        {mso-style-type:personal;
        font-family:"Book Antiqua";
        color:blue;
        font-weight:normal;
        font-style:normal;
        text-decoration:none none;}
span.EmailStyle20
        {mso-style-type:personal-reply;
        font-family:"Book Antiqua";
        color:blue;
        font-weight:normal;
        font-style:normal;
        text-decoration:none none;}
@page Section1
        {size:8.5in 11.0in;
        margin:1.0in 1.25in 1.0in 1.25in;}
div.Section1
        {page:Section1;}
-->
  </style><!--[if gte mso 9]><xml>
 <o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
 <o:shapelayout v:ext="edit">
  <o:idmap v:ext="edit" data="1" />
 </o:shapelayout></xml><![endif]-->
  </o:SmartTagType></o:SmartTagType>
  <div class="Section1">
  <p class="MsoNormal" style=""><font color="black" face="Courier New"
 size="2"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;">I
have written the following code also, it uses xml and infact when this
code
runs it runs perfectally without any problem, it does what I wanted to
do, it
changes the map definition &nbsp;in web layout, and it runs perfectally if I
run
from maestro, &nbsp;but when I try to run from my .net page<o:p></o:p></span></font></p>
  <p class="MsoNormal" style="text-indent: 0.5in;"><font color="black"
 face="Courier New" size="2"><span
 style="font-size: 10pt; font-family: &quot;Courier New&quot;;"><o:p>&nbsp;</o:p></span></font></p>
  <p class="MsoNormal" style=""><font color="black" face="Courier New"
 size="2"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;">&lt;frame
id="viewerFrame" frameborder="no" marginwidth="0"
marginheight="0" scrolling="no"
src="../mapviewernet/ajaxviewer.aspx?SESSION=<span
 style="background: yellow none repeat scroll 0%; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;">&lt;%</span>=sessionId<span
 style="background: yellow none repeat scroll 0%; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;">%&gt;</span>&amp;WEBLAYOUT=<span
 style="background: yellow none repeat scroll 0%; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;">&lt;%</span>=webLayout<span
 style="background: yellow none repeat scroll 0%; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;">%&gt;</span>"&gt;<o:p></o:p></span></font></p>
  <p class="MsoNormal" style="text-indent: 0.5in;"><font color="black"
 face="Courier New" size="2"><span
 style="font-size: 10pt; font-family: &quot;Courier New&quot;;"><o:p>&nbsp;</o:p></span></font></p>
  <p class="MsoNormal" style=""><font color="black" face="Courier New"
 size="2"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;">Then
the problem comes. And it says the following error. <o:p></o:p></span></font></p>
  <p class="MsoNormal" style=""><font color="black" face="Courier New"
 size="2"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;"><o:p>&nbsp;</o:p></span></font></p>
  <p class="MsoNormal"><font color="black" face="Courier New" size="2"><span
 style="font-size: 10pt; font-family: &quot;Courier New&quot;;">Type
'OSGeo.MapGuide.MgNullArgumentException' in Assembly
'MapGuideDotNetApi,
Version=2.0.0.2716, Culture=neutral, PublicKeyToken=null' is not marked
as
serializable.<o:p></o:p></span></font></p>
  <p class="MsoNormal" style=""><font color="black" face="Courier New"
 size="2"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;"><o:p>&nbsp;</o:p></span></font></p>
  <p class="MsoNormal" style=""><font color="black" face="Courier New"
 size="2"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;">If
I
save the map once in maestro then the viewer also runs. I have also
tried to
read the header of xml and passing in resourceSrvc.SetResource as third
parameter, the problem remains the same.<o:p></o:p></span></font></p>
  <p class="MsoNormal" style=""><font color="black" face="Courier New"
 size="2"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;"><o:p>&nbsp;</o:p></span></font></p>
  <p class="MsoNormal" style=""><font color="black" face="Courier New"
 size="2"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;">So
I
just want to confirm whether maestro API you suggested would be the
final and
last way to do this thing, or some other way ? Because I am not aware
of using
maestro api.<o:p></o:p></span></font></p>
  <p class="MsoNormal" style="text-indent: 0.5in;"><font color="black"
 face="Courier New" size="2"><span
 style="font-size: 10pt; font-family: &quot;Courier New&quot;;"><o:p>&nbsp;</o:p></span></font></p>
  <p class="MsoNormal"><font color="black" face="Courier New" size="2"><span
 style="font-size: 10pt; font-family: &quot;Courier New&quot;;"><o:p>&nbsp;</o:p></span></font></p>
  <p class="MsoNormal" style="text-indent: 0.5in;"><font color="black"
 face="Courier New" size="2"><span
 style="font-size: 10pt; font-family: &quot;Courier New&quot;;">//Here
is my code<o:p></o:p></span></font></p>
  <p class="MsoNormal" style="text-indent: 0.5in;"><font color="black"
 face="Courier New" size="2"><span
 style="font-size: 10pt; font-family: &quot;Courier New&quot;;"><o:p>&nbsp;</o:p></span></font></p>
  <p class="MsoNormal" style="text-indent: 0.5in;"><font color="black"
 face="Courier New" size="2"><span
 style="font-size: 10pt; font-family: &quot;Courier New&quot;;">MgUserInformation
userInfo_new = new MgUserInformation(sessionId);<o:p></o:p></span></font></p>
  <p class="MsoNormal" style=""><font color="black" face="Courier New"
 size="2"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
MgSiteConnection siteConnection = new MgSiteConnection();<o:p></o:p></span></font></p>
  <p class="MsoNormal" style=""><font color="black" face="Courier New"
 size="2"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
siteConnection.Open(userInfo_new);<o:p></o:p></span></font></p>
  <p class="MsoNormal" style=""><font color="black" face="Courier New"
 size="2"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
MgResourceService resourceSrvc =
(MgResourceService)siteConnection.CreateService(MgServiceType.ResourceService);<o:p></o:p></span></font></p>
  <p class="MsoNormal" style=""><font color="black" face="Courier New"
 size="2"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
MgMap map = new MgMap();<o:p></o:p></span></font></p>
  <p class="MsoNormal" style=""><font color="black" face="Courier New"
 size="2"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
MgResourceIdentifier resId = new<o:p></o:p></span></font></p>
  <p class="MsoNormal" style=""><font color="black" face="Courier New"
 size="2"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
MgResourceIdentifier("Library://Samples/Sheboygan/Maps/Sheboygan.MapDefinition");<o:p></o:p></span></font></p>
  <p class="MsoNormal" style=""><font color="black" face="Courier New"
 size="2"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
String mapName = resId.GetName();<o:p></o:p></span></font></p>
  <p class="MsoNormal" style=""><font color="black" face="Courier New"
 size="2"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
map.Create(resourceSrvc, resId, mapName);<o:p></o:p></span></font></p>
  <p class="MsoNormal" style=""><font color="black" face="Courier New"
 size="2"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
MgResourceIdentifier mapStateId = new MgResourceIdentifier("Session:"
+ sessionId + "//" + mapName + "." + MgResourceType.Map);<o:p></o:p></span></font></p>
  <p class="MsoNormal" style=""><font color="black" face="Courier New"
 size="2"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
map.Save(resourceSrvc, mapStateId);<o:p></o:p></span></font></p>
  <p class="MsoNormal" style=""><font color="black" face="Courier New"
 size="2"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
MgResourceIdentifier webLayoutId = new MgResourceIdentifier("Library://
Samples/
  <st1:City w:st="on"><st1:place w:st="on">Sheboygan</st1:place></st1:City>
/Layouts\BasicLayout.WebLayout");<o:p></o:p></span></font></p>
  <p class="MsoNormal" style=""><font color="black" face="Courier New"
 size="2"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
MgByteReader byteReader =
resourceSrvc.GetResourceContent(webLayoutId);&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
  <o:p></o:p></span></font></p>
  <p class="MsoNormal" style=""><font color="black" face="Courier New"
 size="2"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
XmlDocument doc = new XmlDocument();<o:p></o:p></span></font></p>
  <p class="MsoNormal" style=""><font color="black" face="Courier New"
 size="2"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
String xmlLayoutDef =
byteReader.ToString();&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <o:p></o:p></span></font></p>
  <p class="MsoNormal" style=""><font color="black" face="Courier New"
 size="2"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
doc.LoadXml(xmlLayoutDef);<o:p></o:p></span></font></p>
  <p class="MsoNormal" style=""><font color="black" face="Courier New"
 size="2"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
XmlNode parentNode = doc.GetElementsByTagName("ResourceId").Item(0);<o:p></o:p></span></font></p>
  <p class="MsoNormal" style=""><font color="black" face="Courier New"
 size="2"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
if (parentNode != null)<o:p></o:p></span></font></p>
  <p class="MsoNormal" style=""><font color="black" face="Courier New"
 size="2"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
{<o:p></o:p></span></font></p>
  <p class="MsoNormal" style=""><font color="black" face="Courier New"
 size="2"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
XmlNode mapRessource =
doc.SelectSingleNode("/WebLayout/Map/ResourceId");<o:p></o:p></span></font></p>
  <p class="MsoNormal" style=""><font color="black" face="Courier New"
 size="2"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
if (mapRessource != null)<o:p></o:p></span></font></p>
  <p class="MsoNormal" style=""><font color="black" face="Courier New"
 size="2"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
{<o:p></o:p></span></font></p>
  <p class="MsoNormal" style=""><font color="black" face="Courier New"
 size="2"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
mapRessource.InnerText = "Library://Samples/Sheboygan/" +
"Maps/Sheboygan"
+
".MapDefinition";&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
  <o:p></o:p></span></font></p>
  <p class="MsoNormal" style=""><font color="black" face="Courier New"
 size="2"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
String string1= doc.DocumentElement.OuterXml;<o:p></o:p></span></font></p>
  <p class="MsoNormal" style=""><font color="black" face="Courier New"
 size="2"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
resourceSrvc.SetResource(webLayoutId, new MgByteReader(string1,
"text/xml"),
null);&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
  <o:p></o:p></span></font></p>
  <p class="MsoNormal" style=""><font color="black" face="Courier New"
 size="2"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
}<o:p></o:p></span></font></p>
  <p class="MsoNormal"><font color="black" face="Courier New" size="2"><span
 style="font-size: 10pt; font-family: &quot;Courier New&quot;;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
}&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></font><font face="Courier New" size="2"><span
 style="font-size: 10pt; font-family: &quot;Courier New&quot;;"><o:p></o:p></span></font></p>
  <p class="MsoNormal"><font color="black" face="Courier New" size="2"><span
 style="font-size: 10pt; font-family: &quot;Courier New&quot;;"><o:p>&nbsp;</o:p></span></font></p>
  <p class="MsoNormal"><font color="blue" face="Book Antiqua" size="2"><span
 style="font-size: 10pt; font-family: &quot;Book Antiqua&quot;; color: blue;"><o:p>&nbsp;</o:p></span></font></p>
  <div>
  <p class="MsoNormal"><b><font color="gray" face="Book Antiqua"
 size="2"><span
 style="font-size: 10pt; font-family: &quot;Book Antiqua&quot;; color: gray; font-weight: bold;">Regards,<o:p></o:p></span></font></b></p>
  <p class="MsoNormal"><font color="gray" face="Times New Roman"
 size="2"><span style="font-size: 11pt; color: gray;">Ravinder <o:p></o:p></span></font></p>
  </div>
  <div>
  <div class="MsoNormal" style="text-align: center;" align="center"><font
 color="black" face="Times New Roman" size="3"><span
 style="font-size: 12pt; color: windowtext;">
  <hr tabindex="-1" align="center" size="2" width="100%"></span></font></div>
  <p class="MsoNormal"><b><font color="black" face="Tahoma" size="2"><span
 style="font-size: 10pt; font-family: Tahoma; color: windowtext; font-weight: bold;">From:</span></font></b><font
 color="black" face="Tahoma" size="2"><span
 style="font-size: 10pt; font-family: Tahoma; color: windowtext;">
<a class="moz-txt-link-abbreviated" href="mailto:mapguide-users-bounces@lists.osgeo.org">mapguide-users-bounces@lists.osgeo.org</a>
[<a class="moz-txt-link-freetext" href="mailto:mapguide-users-bounces@lists.osgeo.org">mailto:mapguide-users-bounces@lists.osgeo.org</a>]
  <b><span style="font-weight: bold;">On Behalf Of </span></b>Kenneth
Skovhede,
GEOGRAF A/S<br>
  <b><span style="font-weight: bold;">Sent:</span></b> Saturday,
February 14, 2009
4:33 PM<br>
  <b><span style="font-weight: bold;">To:</span></b> MapGuide Users
Mail List<br>
  <b><span style="font-weight: bold;">Subject:</span></b> Re:
[mapguide-users]
Regarding Linking of Layers with Map at run time</span></font><font
 color="black"><span style="color: windowtext;"><o:p></o:p></span></font></p>
  </div>
  <p class="MsoNormal"><font color="black" face="Times New Roman"
 size="3"><span style="font-size: 12pt;"><o:p>&nbsp;</o:p></span></font></p>
  <p class="MsoNormal"><font color="black" face="Times New Roman"
 size="3"><span style="font-size: 12pt;">The MgMap class represents a
runtime map, not a
MapDefinition.<br>
There is no such class a a MgMapDefinition, so you have to read/write
the xml.<br>
If you wish to use the standard viewer, you have to do this.<br>
I was very annoyed by this, so I created the MaestroAPI that has
classes for
all the Xml documents,<br>
including the MapDefinition:<br>
  <a moz-do-not-send="true"
 href="http://trac.osgeo.org/mapguide/wiki/maestro/MaestroAPI">http://trac.osgeo.org/mapguide/wiki/maestro/MaestroAPI</a><br>
  <br>
If you start the viewer with an empty map, you can access the MgMap
object,<br>
and add layers as runtime layers, using the MgMap.Layers.Add method.<br>
  <br>
  <br>
  <o:p></o:p></span></font></p>
  <pre><font color="black" face="Courier New" size="2"><span
 style="font-size: 10pt;">Regards, Kenneth Skovhede, GEOGRAF A/S<o:p></o:p></span></font></pre>
  <p class="MsoNormal"><font color="black" face="Times New Roman"
 size="3"><span style="font-size: 12pt;"><br>
  <br>
  <a moz-do-not-send="true" href="mailto:ravinder.singh@BIRLASOFT.COM">ravinder.singh@BIRLASOFT.COM</a>
skrev: <o:p></o:p></span></font></p>
  <p class="MsoNormal"><font color="blue" face="Book Antiqua" size="2"><span
 style="font-size: 10pt; font-family: &quot;Book Antiqua&quot;; color: blue;"><u1:SmartTagType
 namespaceuri="urn:schemas-microsoft-com:office:smarttags" name="City"><u1:SmartTagType
 namespaceuri="urn:schemas-microsoft-com:office:smarttags" name="place"><u1:SmartTagType
 namespaceuri="urn:schemas-microsoft-com:office:smarttags"
 name="PersonName"><!--[if gte mso 9]><xml>
    <u1:shapedefaults u2:ext="edit" spidmax="1026"/>
</xml><![endif]--><!--[if gte mso 9]><xml>
    <u1:shapelayout u3:ext="edit">
     <u1:idmap u3:ext="edit" data="1"/>
    </u1:shapelayout>
</xml><![endif]--></u1:SmartTagType></u1:SmartTagType></u1:SmartTagType>Hi
Stefan,<u1:p></u1:p></span></font><o:p></o:p></p>
  <p class="MsoNormal"><font color="blue" face="Book Antiqua" size="2"><span
 style="font-size: 10pt; font-family: &quot;Book Antiqua&quot;; color: blue;"><u1:p>&nbsp;</u1:p></span></font><o:p></o:p></p>
  <p class="MsoNormal"><font color="blue" face="Book Antiqua" size="2"><span
 style="font-size: 10pt; font-family: &quot;Book Antiqua&quot;; color: blue;">I
put the way
you said but it gives the following error now.<u1:p></u1:p></span></font><o:p></o:p></p>
  <p class="MsoNormal"><font color="blue" face="Book Antiqua" size="2"><span
 style="font-size: 10pt; font-family: &quot;Book Antiqua&quot;; color: blue;"><u1:p>&nbsp;</u1:p></span></font><o:p></o:p></p>
  <p class="MsoNormal"><font color="blue" face="Book Antiqua" size="2"><span
 style="font-size: 10pt; font-family: &quot;Book Antiqua&quot;; color: blue;">Type
'OSGeo.MapGuide.MgXmlParserException' in Assembly 'MapGuideDotNetApi,
Version=2.0.0.2716, Culture=neutral, PublicKeyToken=null' is not marked
as
serializable.<u1:p></u1:p></span></font><o:p></o:p></p>
  <p class="MsoNormal"><font color="blue" face="Book Antiqua" size="2"><span
 style="font-size: 10pt; font-family: &quot;Book Antiqua&quot;; color: blue;"><u1:p>&nbsp;</u1:p></span></font><o:p></o:p></p>
  <div>
  <p class="MsoNormal"><b><font color="gray" face="Book Antiqua"
 size="2"><span
 style="font-size: 10pt; font-family: &quot;Book Antiqua&quot;; color: gray; font-weight: bold;">Regards,<u1:p></u1:p></span></font></b><o:p></o:p></p>
  <p class="MsoNormal"><st1:PersonName u4:st="on"><font color="gray"
 face="Times New Roman" size="2"><span
 style="font-size: 11pt; color: gray;">Ravinder Singh</span></font></st1:PersonName><o:p></o:p></p>
  </div>
  <u1:p></u1:p>
  <div>
  <div class="MsoNormal" style="text-align: center;" align="center"><font
 color="black" face="Times New Roman" size="3"><span
 style="font-size: 12pt; color: windowtext;">
  <hr tabindex="-1" align="center" size="2" width="100%"></span></font></div>
  <p class="MsoNormal"><b><font color="black" face="Tahoma" size="2"><span
 style="font-size: 10pt; font-family: Tahoma; color: windowtext; font-weight: bold;">From:</span></font></b><font
 color="black" face="Tahoma" size="2"><span
 style="font-size: 10pt; font-family: Tahoma; color: windowtext;"> <a
 moz-do-not-send="true"
 href="mailto:mapguide-users-bounces@lists.osgeo.org">mapguide-users-bounces@lists.osgeo.org</a>
[<a moz-do-not-send="true"
 href="mailto:mapguide-users-bounces@lists.osgeo.org">mailto:mapguide-users-bounces@lists.osgeo.org</a>]
  <b><span style="font-weight: bold;">On Behalf Of </span></b>Stefan
Dalakov<br>
  <b><span style="font-weight: bold;">Sent:</span></b> Friday, February
13, 2009
11:10 PM<br>
  <b><span style="font-weight: bold;">To:</span></b> MapGuide Users
Mail List<br>
  <b><span style="font-weight: bold;">Subject:</span></b> Re:
[mapguide-users]
Regarding Linking of Layers with Map at run time</span></font><o:p></o:p></p>
  </div>
  <u1:p></u1:p>
  <p class="MsoNormal"><font color="black" face="Times New Roman"
 size="3"><span style="font-size: 12pt;"><u1:p>&nbsp;</u1:p><o:p></o:p></span></font></p>
  <p class="MsoNormal"><font color="black" face="Times New Roman"
 size="3"><span style="font-size: 12pt;">Try <br>
  </span></font><font face="Courier New" size="2"><span
 style="font-size: 10pt; font-family: &quot;Courier New&quot;;">MgResourceIdentifier
mapName = new
MgResourceIdentifier("Session:" + sessionId +
"//Sheboygan.MapDefinition");<br>
  <br>
  <br>
Stefan Dalakov<br>
  <br>
  </span></font><a href="mailto:ravinder.singh@BIRLASOFT.COM"
 moz-do-not-send="true">ravinder.singh@BIRLASOFT.COM</a> wrote: <u1:p></u1:p><o:p></o:p></p>
  <p class="MsoNormal"><font color="black" face="Courier New" size="2"><span
 style="font-size: 10pt; font-family: &quot;Courier New&quot;;"><u5:SmartTagType
 namespaceuri="urn:schemas-microsoft-com:office:smarttags" name="City"><u5:SmartTagType
 namespaceuri="urn:schemas-microsoft-com:office:smarttags" name="place"><u5:SmartTagType
 namespaceuri="urn:schemas-microsoft-com:office:smarttags"
 name="PersonName"><!--[if gte mso 9]><xml>
    <u5:shapedefaults u2:ext="edit" spidmax="1026"/>
</xml><![endif]--><!--[if gte mso 9]><xml>
    <u5:shapelayout u3:ext="edit">
     <u5:idmap u3:ext="edit" data="1"/>
    </u5:shapelayout>
</xml><![endif]--></u5:SmartTagType></u5:SmartTagType></u5:SmartTagType>Hi
All,<u5:p></u5:p></span></font><u1:p></u1:p><o:p></o:p></p>
  <p class="MsoNormal" style="text-indent: 0.5in;"><font color="black"
 face="Courier New" size="2"><span
 style="font-size: 10pt; font-family: &quot;Courier New&quot;;"><u5:p>&nbsp;</u5:p></span></font><u1:p></u1:p><o:p></o:p></p>
  <p class="MsoNormal"><font color="black" face="Courier New" size="2"><span
 style="font-size: 10pt; font-family: &quot;Courier New&quot;;">I have created
the map
definition in maestro and also created a web layout, and I have
hundreds of
Maps, and each map will have a single layer, but I don&#8217;t want to create
the hundreds of maps for each single layer. For that purpose I though I
will
just make a single map and will associate the layer at run time to that
map. So
I wrote the following set of code for <st1:City u6:st="on"><st1:place
 u6:st="on"><st1:City u4:st="on"><st1:place u4:st="on"><st1:City
 w:st="on"><st1:place w:st="on">Sheboygan</st1:place></st1:City></st1:place></st1:City></st1:place></st1:City>
sample<u5:p></u5:p></span></font><u1:p></u1:p><o:p></o:p></p>
  <p class="MsoNormal"><font color="black" face="Courier New" size="2"><span
 style="font-size: 10pt; font-family: &quot;Courier New&quot;;"><u5:p>&nbsp;</u5:p></span></font><u1:p></u1:p><o:p></o:p></p>
  <p class="MsoNormal"><font color="black" face="Courier New" size="2"><span
 style="font-size: 10pt; font-family: &quot;Courier New&quot;;">But when I reach
to
map.Save(resourceSrvc, mapName) <u5:p></u5:p></span></font><u1:p></u1:p><o:p></o:p></p>
  <p class="MsoNormal"><font color="black" face="Courier New" size="2"><span
 style="font-size: 10pt; font-family: &quot;Courier New&quot;;"><u5:p>&nbsp;</u5:p></span></font><u1:p></u1:p><o:p></o:p></p>
  <p class="MsoNormal"><font color="black" face="Courier New" size="2"><span
 style="font-size: 10pt; font-family: &quot;Courier New&quot;;">it gives me the
error <u5:p></u5:p></span></font><u1:p></u1:p><o:p></o:p></p>
  <p class="MsoNormal"><font color="black" face="Courier New" size="2"><span
 style="font-size: 10pt; font-family: &quot;Courier New&quot;;"><u5:p>&nbsp;</u5:p></span></font><u1:p></u1:p><o:p></o:p></p>
  <p class="MsoNormal"><font color="black" face="Courier New" size="2"><span
 style="font-size: 10pt; font-family: &quot;Courier New&quot;;">MgXmlParserException
{"An exception occurred in the XML parser."}<u5:p></u5:p></span></font><u1:p></u1:p><o:p></o:p></p>
  <p class="MsoNormal"><font color="black" face="Courier New" size="2"><span
 style="font-size: 10pt; font-family: &quot;Courier New&quot;;"><u5:p>&nbsp;</u5:p></span></font><u1:p></u1:p><o:p></o:p></p>
  <p class="MsoNormal"><font color="black" face="Courier New" size="2"><span
 style="font-size: 10pt; font-family: &quot;Courier New&quot;;">And also I tried
with Map.Open
and then the following error comes<u5:p></u5:p></span></font><u1:p></u1:p><o:p></o:p></p>
  <p class="MsoNormal"><font color="black" face="Courier New" size="2"><span
 style="font-size: 10pt; font-family: &quot;Courier New&quot;;"><u5:p>&nbsp;</u5:p></span></font><u1:p></u1:p><o:p></o:p></p>
  <p class="MsoNormal"><font color="black" face="Courier New" size="2"><span
 style="font-size: 10pt; font-family: &quot;Courier New&quot;;">Resource was not
found:
Session:b275c3b6-ffff-ffff-8000-001a4bb4a756_en_7F0000010AFC0AFB0AFA//Samples/Sheboygan/Sheboygan.MapDefinition<u5:p></u5:p></span></font><u1:p></u1:p><o:p></o:p></p>
  <p class="MsoNormal"><font color="black" face="Courier New" size="2"><span
 style="font-size: 10pt; font-family: &quot;Courier New&quot;;"><u5:p>&nbsp;</u5:p></span></font><u1:p></u1:p><o:p></o:p></p>
  <p class="MsoNormal" style="margin-left: -0.5in; text-indent: 0.5in;"><font
 color="black" face="Courier New" size="2"><span
 style="font-size: 10pt; font-family: &quot;Courier New&quot;;">I
have written the following code<u5:p></u5:p></span></font><u1:p></u1:p><o:p></o:p></p>
  <p class="MsoNormal" style="margin-left: -0.5in; text-indent: 0.5in;"><font
 color="black" face="Courier New" size="2"><span
 style="font-size: 10pt; font-family: &quot;Courier New&quot;;"><u5:p>&nbsp;</u5:p></span></font><u1:p></u1:p><o:p></o:p></p>
  <p class="MsoNormal" style="margin-left: -0.5in; text-indent: 0.5in;"><font
 color="black" face="Courier New" size="2"><span
 style="font-size: 10pt; font-family: &quot;Courier New&quot;;">MgUserInformation
userInfo = new MgUserInformation(defaultUser, defaultPassword);<u5:p></u5:p></span></font><u1:p></u1:p><o:p></o:p></p>
  <p class="MsoNormal"><font color="black" face="Courier New" size="2"><span
 style="font-size: 10pt; font-family: &quot;Courier New&quot;;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
MgSite site = new MgSite();<u5:p></u5:p></span></font><u1:p></u1:p><o:p></o:p></p>
  <p class="MsoNormal"><font color="black" face="Courier New" size="2"><span
 style="font-size: 10pt; font-family: &quot;Courier New&quot;;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
site.Open(userInfo);<u5:p></u5:p></span></font><u1:p></u1:p><o:p></o:p></p>
  <p class="MsoNormal"><font color="black" face="Courier New" size="2"><span
 style="font-size: 10pt; font-family: &quot;Courier New&quot;;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
sessionId = site.CreateSession();<u5:p></u5:p></span></font><u1:p></u1:p><o:p></o:p></p>
  <p class="MsoNormal" style="margin-left: -0.5in; text-indent: 0.5in;"><font
 color="black" face="Courier New" size="2"><span
 style="font-size: 10pt; font-family: &quot;Courier New&quot;;">MgUserInformation
userInfo_new = new MgUserInformation(sessionId);<u5:p></u5:p></span></font><u1:p></u1:p><o:p></o:p></p>
  <p class="MsoNormal"><font color="black" face="Courier New" size="2"><span
 style="font-size: 10pt; font-family: &quot;Courier New&quot;;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
MgSiteConnection siteConnection = new MgSiteConnection();<u5:p></u5:p></span></font><u1:p></u1:p><o:p></o:p></p>
  <p class="MsoNormal"><font color="black" face="Courier New" size="2"><span
 style="font-size: 10pt; font-family: &quot;Courier New&quot;;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
siteConnection.Open(userInfo_new);<u5:p></u5:p></span></font><u1:p></u1:p><o:p></o:p></p>
  <p class="MsoNormal"><font color="black" face="Courier New" size="2"><span
 style="font-size: 10pt; font-family: &quot;Courier New&quot;;">MgResourceService
resourceSrvc =
(MgResourceService)siteConnection.CreateService(MgServiceType.ResourceService);&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
  <u5:p></u5:p></span></font><u1:p></u1:p><o:p></o:p></p>
  <p class="MsoNormal"><font color="black" face="Courier New" size="2"><span
 style="font-size: 10pt; font-family: &quot;Courier New&quot;;">MgResourceIdentifier
mapName
= new MgResourceIdentifier("Session:" + sessionId +
"//Samples/Sheboygan/Sheboygan.MapDefinition");<u5:p></u5:p></span></font><u1:p></u1:p><o:p></o:p></p>
  <p class="MsoNormal"><font color="black" face="Courier New" size="2"><span
 style="font-size: 10pt; font-family: &quot;Courier New&quot;;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
MgMap map = new MgMap();<u5:p></u5:p></span></font><u1:p></u1:p><o:p></o:p></p>
  <p class="MsoNormal"><font color="black" face="Courier New" size="2"><span
 style="font-size: 10pt; font-family: &quot;Courier New&quot;;">&nbsp;&nbsp;&nbsp;&nbsp;
&nbsp;map.Open(resourceSrvc, mapName); // Here the problem comes<u5:p></u5:p></span></font><u1:p></u1:p><o:p></o:p></p>
  <p class="MsoNormal"><font color="black" face="Courier New" size="2"><span
 style="font-size: 10pt; font-family: &quot;Courier New&quot;;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
map.Save(resourceSrvc, mapName); // Here the problem comes</span></font><u1:p></u1:p><o:p></o:p></p>
  <u5:p></u5:p>
  <p class="MsoNormal"><font color="black" face="Book Antiqua" size="2"><span
 style="font-size: 10pt; font-family: &quot;Book Antiqua&quot;;"><u5:p>&nbsp;</u5:p></span></font><u1:p></u1:p><o:p></o:p></p>
  <p class="MsoNormal"><font color="black" face="Courier New" size="2"><span
 style="font-size: 10pt; font-family: &quot;Courier New&quot;;">I am using .net
aspx with
map guide 2.0<u5:p></u5:p></span></font><u1:p></u1:p><o:p></o:p></p>
  <p class="MsoNormal"><font color="black" face="Book Antiqua" size="2"><span
 style="font-size: 10pt; font-family: &quot;Book Antiqua&quot;;"><u5:p>&nbsp;</u5:p></span></font><u1:p></u1:p><o:p></o:p></p>
  <p class="MsoNormal"><b><font color="gray" face="Book Antiqua"
 size="2"><span
 style="font-size: 10pt; font-family: &quot;Book Antiqua&quot;; color: gray; font-weight: bold;">Thanks
&amp; Regards,<u5:p></u5:p></span></font></b><u1:p></u1:p><o:p></o:p></p>
  <p class="MsoNormal"><st1:PersonName u6:st="on"><font color="gray"
 face="Times New Roman" size="2"><span
 style="font-size: 11pt; color: gray;">Ravinder Singh</span></font></st1:PersonName><u1:p></u1:p><o:p></o:p></p>
  <u5:p></u5:p>
  <p class="MsoNormal"><font color="black" face="Times New Roman"
 size="3"><span style="font-size: 12pt;"><u5:p>&nbsp;</u5:p><u1:p></u1:p><o:p></o:p></span></font></p>
  <table class="MsoNormalTable" border="0" cellpadding="0">
    <tbody>
      <tr>
        <td
 style="padding: 0.75pt; background: white none repeat scroll 0%; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;"
 bgcolor="white">
        <p class="MsoNormal"><font color="black" face="Times New Roman"
 size="3"><span style="font-size: 12pt;">*********************************************************************************************************************************************************************<br>
"This message and any attachments are solely for the intended recipient
and may contain Birlasoft confidential or privileged information. If
you are not the intended recipient,any disclosure,copying, use, or
distribution of the information included in this message and any
attachments is <br>
prohibited. If you have received this communication in error, please
notify us by reply e-mail at (<a
 href="mailto:administrator@birlasoft.com" moz-do-not-send="true">administrator@birlasoft.com</a>)
and permanently delete this message and any attachments. Thank you."<br>
*********************************************************************************************************************************************************************<u1:p></u1:p><o:p></o:p></span></font></p>
        </td>
      </tr>
    </tbody>
  </table>
  <pre wrap=""><font color="black" face="Courier New" size="2"><span
 style="font-size: 10pt;"><u1:p>&nbsp;</u1:p><o:p></o:p></span></font></pre>
  <pre style="text-align: center;"><font color="black"
 face="Courier New" size="2"><span style="font-size: 10pt;"><o:p>&nbsp;</o:p></span></font></pre>
  <pre style="text-align: center;"><font color="black"
 face="Courier New" size="2"><span style="font-size: 10pt;"><o:p>&nbsp;</o:p></span></font></pre>
  <pre style="text-align: center;"><font color="black"
 face="Courier New" size="2"><span style="font-size: 10pt;">

<hr align="center" size="4" width="90%">

</span></font></pre>
  <pre style="text-align: center;"><font color="black"
 face="Courier New" size="2"><span style="font-size: 10pt;"><o:p>&nbsp;</o:p></span></font></pre>
  <pre style="text-align: center;"><font color="black"
 face="Courier New" size="2"><span style="font-size: 10pt;"><o:p>&nbsp;</o:p></span></font></pre>
  <pre><font color="black" face="Courier New" size="2"><span
 style="font-size: 10pt;"><u1:p>&nbsp;</u1:p><o:p></o:p></span></font></pre>
  <pre><font color="black" face="Courier New" size="2"><span
 style="font-size: 10pt;">_______________________________________________<u1:p></u1:p><o:p></o:p></span></font></pre>
  <pre><font color="black" face="Courier New" size="2"><span
 style="font-size: 10pt;">mapguide-users mailing list<u1:p></u1:p><o:p></o:p></span></font></pre>
  <pre><font color="black" face="Courier New" size="2"><span
 style="font-size: 10pt;"><a
 href="mailto:mapguide-users@lists.osgeo.org" moz-do-not-send="true">mapguide-users@lists.osgeo.org</a><u1:p></u1:p><o:p></o:p></span></font></pre>
  <pre><font color="black" face="Courier New" size="2"><span
 style="font-size: 10pt;"><a
 href="http://lists.osgeo.org/mailman/listinfo/mapguide-users"
 moz-do-not-send="true">http://lists.osgeo.org/mailman/listinfo/mapguide-users</a><u1:p></u1:p><o:p></o:p></span></font></pre>
  <pre><font color="black" face="Courier New" size="2"><span
 style="font-size: 10pt;">&nbsp; <u1:p></u1:p><o:p></o:p></span></font></pre>
  <p class="MsoNormal"><font color="black" face="Times New Roman"
 size="3"><span style="font-size: 12pt;"><u1:p>&nbsp;</u1:p><o:p></o:p></span></font></p>
  <table class="MsoNormalTable" border="0" cellpadding="0">
    <tbody>
      <tr>
        <td
 style="padding: 0.75pt; background: white none repeat scroll 0%; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;"
 bgcolor="white">
        <p class="MsoNormal"><font color="black" face="Times New Roman"
 size="3"><span style="font-size: 12pt;">*********************************************************************************************************************************************************************<br>
"This message and any attachments are solely for the intended recipient
and may contain Birlasoft confidential or privileged information. If
you are not the intended recipient,any disclosure,copying, use, or
distribution of the information included in this message and any
attachments is <br>
prohibited. If you have received this communication in error, please
notify us by reply e-mail at (<a moz-do-not-send="true"
 href="mailto:administrator@birlasoft.com">administrator@birlasoft.com</a>)
and permanently delete this message and any attachments. Thank you."<br>
*********************************************************************************************************************************************************************<o:p></o:p></span></font></p>
        </td>
      </tr>
    </tbody>
  </table>
  <pre wrap=""><font color="black" face="Courier New" size="2"><span
 style="font-size: 10pt;"><o:p>&nbsp;</o:p></span></font></pre>
  <pre style="text-align: center;"><font color="black"
 face="Courier New" size="2"><span style="font-size: 10pt;">

<hr align="center" size="4" width="90%">

</span></font></pre>
  <pre><font color="black" face="Courier New" size="2"><span
 style="font-size: 10pt;"><o:p>&nbsp;</o:p></span></font></pre>
  <pre><font color="black" face="Courier New" size="2"><span
 style="font-size: 10pt;">_______________________________________________<o:p></o:p></span></font></pre>
  <pre><font color="black" face="Courier New" size="2"><span
 style="font-size: 10pt;">mapguide-users mailing list<o:p></o:p></span></font></pre>
  <pre><font color="black" face="Courier New" size="2"><span
 style="font-size: 10pt;"><a moz-do-not-send="true"
 href="mailto:mapguide-users@lists.osgeo.org">mapguide-users@lists.osgeo.org</a><o:p></o:p></span></font></pre>
  <pre><font color="black" face="Courier New" size="2"><span
 style="font-size: 10pt;"><a moz-do-not-send="true"
 href="http://lists.osgeo.org/mailman/listinfo/mapguide-users">http://lists.osgeo.org/mailman/listinfo/mapguide-users</a><o:p></o:p></span></font></pre>
  <pre><font color="black" face="Courier New" size="2"><span
 style="font-size: 10pt;">&nbsp; <o:p></o:p></span></font></pre>
  </div>
  <table>
    <tbody>
      <tr>
        <td bgcolor="#ffffff"><font color="#000000">*********************************************************************************************************************************************************************<br>
"This message and any attachments are solely for the intended recipient
and may contain Birlasoft confidential or privileged information. If
you are not the intended recipient,any disclosure,copying, use, or
distribution of the information included in this message and any
attachments is <br>
prohibited. If you have received this communication in error, please
notify us by reply e-mail at (<a class="moz-txt-link-abbreviated" href="mailto:administrator@birlasoft.com">administrator@birlasoft.com</a>) and
permanently delete this message and any attachments. Thank you."<br>
*********************************************************************************************************************************************************************<br>
        </font></td>
      </tr>
    </tbody>
  </table>
  <pre wrap="">
<hr size="4" width="90%">
_______________________________________________
mapguide-users mailing list
<a class="moz-txt-link-abbreviated" href="mailto:mapguide-users@lists.osgeo.org">mapguide-users@lists.osgeo.org</a>
<a class="moz-txt-link-freetext" href="http://lists.osgeo.org/mailman/listinfo/mapguide-users">http://lists.osgeo.org/mailman/listinfo/mapguide-users</a>
  </pre>
</blockquote>
</body>
</html>