<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:st1="urn:schemas-microsoft-com:office:smarttags" xmlns="http://www.w3.org/TR/REC-html40">

<head>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=us-ascii">
<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"/>
<o:SmartTagType namespaceuri="urn:schemas-microsoft-com:office:smarttags"
 name="PersonName"/>
<!--[if !mso]>
<style>
st1\:*{behavior:url(#default#ieooui) }
</style>
<![endif]-->
<style>
<!--
 /* Font Definitions */
 @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.EmailStyle17
        {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-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]-->
</head>

<body bgcolor=white lang=EN-US link=blue vlink=purple>

<div class=Section1>

<p class=MsoNormal><font size=2 color=blue face="Book Antiqua"><span
style='font-size:10.0pt;font-family:"Book Antiqua";color:blue'>Hi Stefan,<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 color=blue face="Book Antiqua"><span
style='font-size:10.0pt;font-family:"Book Antiqua";color:blue'><o:p>&nbsp;</o:p></span></font></p>

<p class=MsoNormal><font size=2 color=blue face="Book Antiqua"><span
style='font-size:10.0pt;font-family:"Book Antiqua";color:blue'>I put the way
you said but it gives the following error now.<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 color=blue face="Book Antiqua"><span
style='font-size:10.0pt;font-family:"Book Antiqua";color:blue'><o:p>&nbsp;</o:p></span></font></p>

<p class=MsoNormal><font size=2 color=blue face="Book Antiqua"><span
style='font-size:10.0pt;font-family:"Book Antiqua";color:blue'>Type 'OSGeo.MapGuide.MgXmlParserException'
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><font size=2 color=blue face="Book Antiqua"><span
style='font-size:10.0pt;font-family:"Book Antiqua";color:blue'><o:p>&nbsp;</o:p></span></font></p>

<div>

<p class=MsoNormal><b><font size=2 color=gray face="Book Antiqua"><span
style='font-size:10.0pt;font-family:"Book Antiqua";color:gray;font-weight:bold'>Regards,<o:p></o:p></span></font></b></p>

<p class=MsoNormal><st1:PersonName w:st="on"><font size=2 color=gray
 face="Times New Roman"><span style='font-size:11.0pt;color:gray'>Ravinder
 Singh</span></font></st1:PersonName><font size=2 color=gray><span
style='font-size:11.0pt;color:gray'><o:p></o:p></span></font></p>

</div>

<div>

<div class=MsoNormal align=center style='text-align:center'><font size=3
color=black face="Times New Roman"><span style='font-size:12.0pt;color:windowtext'>

<hr size=2 width="100%" align=center tabindex=-1>

</span></font></div>

<p class=MsoNormal><b><font size=2 color=black face=Tahoma><span
style='font-size:10.0pt;font-family:Tahoma;color:windowtext;font-weight:bold'>From:</span></font></b><font
size=2 color=black face=Tahoma><span style='font-size:10.0pt;font-family:Tahoma;
color:windowtext'> mapguide-users-bounces@lists.osgeo.org [mailto:mapguide-users-bounces@lists.osgeo.org]
<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><font
color=black><span style='color:windowtext'><o:p></o:p></span></font></p>

</div>

<p class=MsoNormal><font size=3 color=black face="Times New Roman"><span
style='font-size:12.0pt'><o:p>&nbsp;</o:p></span></font></p>

<p class=MsoNormal><font size=3 color=black face="Times New Roman"><span
style='font-size:12.0pt'>Try <br>
</span></font><font size=2 face="Courier New"><span style='font-size:10.0pt;
font-family:"Courier New"'>MgResourceIdentifier mapName = new
MgResourceIdentifier(&quot;Session:&quot; + sessionId +
&quot;//Sheboygan.MapDefinition&quot;);<br>
<br>
<br>
Stefan Dalakov<br>
<br>
</span></font><a href="mailto:ravinder.singh@BIRLASOFT.COM">ravinder.singh@BIRLASOFT.COM</a>
wrote: <o:p></o:p></p>

<p class=MsoNormal><font size=2 color=black face="Courier New"><span
style='font-size:10.0pt;font-family:"Courier New"'><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 All,<u1:p></u1:p></span></font><o:p></o:p></p>

<p class=MsoNormal style='text-indent:.5in'><font size=2 color=black
face="Courier New"><span style='font-size:10.0pt;font-family:"Courier New"'><u1:p>&nbsp;</u1:p></span></font><o:p></o:p></p>

<p class=MsoNormal><font size=2 color=black face="Courier New"><span
style='font-size:10.0pt;font-family:"Courier New"'>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 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>
sample<u1:p></u1:p></span></font><o:p></o:p></p>

<p class=MsoNormal><font size=2 color=black face="Courier New"><span
style='font-size:10.0pt;font-family:"Courier New"'><u1:p>&nbsp;</u1:p></span></font><o:p></o:p></p>

<p class=MsoNormal><font size=2 color=black face="Courier New"><span
style='font-size:10.0pt;font-family:"Courier New"'>But when I reach to
map.Save(resourceSrvc, mapName) <u1:p></u1:p></span></font><o:p></o:p></p>

<p class=MsoNormal><font size=2 color=black face="Courier New"><span
style='font-size:10.0pt;font-family:"Courier New"'><u1:p>&nbsp;</u1:p></span></font><o:p></o:p></p>

<p class=MsoNormal><font size=2 color=black face="Courier New"><span
style='font-size:10.0pt;font-family:"Courier New"'>it gives me the error <u1:p></u1:p></span></font><o:p></o:p></p>

<p class=MsoNormal><font size=2 color=black face="Courier New"><span
style='font-size:10.0pt;font-family:"Courier New"'><u1:p>&nbsp;</u1:p></span></font><o:p></o:p></p>

<p class=MsoNormal><font size=2 color=black face="Courier New"><span
style='font-size:10.0pt;font-family:"Courier New"'>MgXmlParserException
{&quot;An exception occurred in the XML parser.&quot;}<u1:p></u1:p></span></font><o:p></o:p></p>

<p class=MsoNormal><font size=2 color=black face="Courier New"><span
style='font-size:10.0pt;font-family:"Courier New"'><u1:p>&nbsp;</u1:p></span></font><o:p></o:p></p>

<p class=MsoNormal><font size=2 color=black face="Courier New"><span
style='font-size:10.0pt;font-family:"Courier New"'>And also I tried with
Map.Open and then the following error comes<u1:p></u1:p></span></font><o:p></o:p></p>

<p class=MsoNormal><font size=2 color=black face="Courier New"><span
style='font-size:10.0pt;font-family:"Courier New"'><u1:p>&nbsp;</u1:p></span></font><o:p></o:p></p>

<p class=MsoNormal><font size=2 color=black face="Courier New"><span
style='font-size:10.0pt;font-family:"Courier New"'>Resource was not found:
Session:b275c3b6-ffff-ffff-8000-001a4bb4a756_en_7F0000010AFC0AFB0AFA//Samples/Sheboygan/Sheboygan.MapDefinition<u1:p></u1:p></span></font><o:p></o:p></p>

<p class=MsoNormal><font size=2 color=black face="Courier New"><span
style='font-size:10.0pt;font-family:"Courier New"'><u1:p>&nbsp;</u1:p></span></font><o:p></o:p></p>

<p class=MsoNormal style='margin-left:-.5in;text-indent:.5in'><font size=2
color=black face="Courier New"><span style='font-size:10.0pt;font-family:"Courier New"'>I
have written the following code<u1:p></u1:p></span></font><o:p></o:p></p>

<p class=MsoNormal style='margin-left:-.5in;text-indent:.5in'><font size=2
color=black face="Courier New"><span style='font-size:10.0pt;font-family:"Courier New"'><u1:p>&nbsp;</u1:p></span></font><o:p></o:p></p>

<p class=MsoNormal style='margin-left:-.5in;text-indent:.5in'><font size=2
color=black face="Courier New"><span style='font-size:10.0pt;font-family:"Courier New"'>MgUserInformation
userInfo = new MgUserInformation(defaultUser, defaultPassword);<u1:p></u1:p></span></font><o:p></o:p></p>

<p class=MsoNormal><font size=2 color=black face="Courier New"><span
style='font-size:10.0pt;font-family:"Courier New"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
MgSite site = new MgSite();<u1:p></u1:p></span></font><o:p></o:p></p>

<p class=MsoNormal><font size=2 color=black face="Courier New"><span
style='font-size:10.0pt;font-family:"Courier New"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
site.Open(userInfo);<u1:p></u1:p></span></font><o:p></o:p></p>

<p class=MsoNormal><font size=2 color=black face="Courier New"><span
style='font-size:10.0pt;font-family:"Courier New"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
sessionId = site.CreateSession();<u1:p></u1:p></span></font><o:p></o:p></p>

<p class=MsoNormal style='margin-left:-.5in;text-indent:.5in'><font size=2
color=black face="Courier New"><span style='font-size:10.0pt;font-family:"Courier New"'>MgUserInformation
userInfo_new = new MgUserInformation(sessionId);<u1:p></u1:p></span></font><o:p></o:p></p>

<p class=MsoNormal><font size=2 color=black face="Courier New"><span
style='font-size:10.0pt;font-family:"Courier New"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
MgSiteConnection siteConnection = new MgSiteConnection();<u1:p></u1:p></span></font><o:p></o:p></p>

<p class=MsoNormal><font size=2 color=black face="Courier New"><span
style='font-size:10.0pt;font-family:"Courier New"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
siteConnection.Open(userInfo_new);<u1:p></u1:p></span></font><o:p></o:p></p>

<p class=MsoNormal><font size=2 color=black face="Courier New"><span
style='font-size:10.0pt;font-family:"Courier New"'>MgResourceService
resourceSrvc =
(MgResourceService)siteConnection.CreateService(MgServiceType.ResourceService);&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<u1:p></u1:p></span></font><o:p></o:p></p>

<p class=MsoNormal><font size=2 color=black face="Courier New"><span
style='font-size:10.0pt;font-family:"Courier New"'>MgResourceIdentifier mapName
= new MgResourceIdentifier(&quot;Session:&quot; + sessionId +
&quot;//Samples/Sheboygan/Sheboygan.MapDefinition&quot;);<u1:p></u1:p></span></font><o:p></o:p></p>

<p class=MsoNormal><font size=2 color=black face="Courier New"><span
style='font-size:10.0pt;font-family:"Courier New"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
MgMap map = new MgMap();<u1:p></u1:p></span></font><o:p></o:p></p>

<p class=MsoNormal><font size=2 color=black face="Courier New"><span
style='font-size:10.0pt;font-family:"Courier New"'>&nbsp;&nbsp;&nbsp;&nbsp;
&nbsp;map.Open(resourceSrvc, mapName); // Here the problem comes<u1:p></u1:p></span></font><o:p></o:p></p>

<p class=MsoNormal><font size=2 color=black face="Courier New"><span
style='font-size:10.0pt;font-family:"Courier New"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
map.Save(resourceSrvc, mapName); // Here the problem comes</span></font><o:p></o:p></p>

<u1:p></u1:p>

<p class=MsoNormal><font size=2 color=black face="Book Antiqua"><span
style='font-size:10.0pt;font-family:"Book Antiqua"'><u1:p>&nbsp;</u1:p></span></font><o:p></o:p></p>

<p class=MsoNormal><font size=2 color=black face="Courier New"><span
style='font-size:10.0pt;font-family:"Courier New"'>I am using .net aspx with
map guide 2.0<u1:p></u1:p></span></font><o:p></o:p></p>

<p class=MsoNormal><font size=2 color=black face="Book Antiqua"><span
style='font-size:10.0pt;font-family:"Book Antiqua"'><u1:p>&nbsp;</u1:p></span></font><o:p></o:p></p>

<p class=MsoNormal><b><font size=2 color=gray face="Book Antiqua"><span
style='font-size:10.0pt;font-family:"Book Antiqua";color:gray;font-weight:bold'>Thanks
&amp; Regards,<u1:p></u1:p></span></font></b><o:p></o:p></p>

<p class=MsoNormal><st1:PersonName u4:st="on"><font size=2 color=gray
face="Times New Roman"><span style='font-size:11.0pt;color:gray'>Ravinder Singh</span></font></st1:PersonName><o:p></o:p></p>

<u1:p></u1:p>

<p class=MsoNormal><font size=3 color=black face="Times New Roman"><span
style='font-size:12.0pt'><u1:p>&nbsp;</u1:p><o:p></o:p></span></font></p>

<table class=MsoNormalTable border=0 cellpadding=0>
 <tr>
  <td bgcolor=white style='background:white;padding:.75pt .75pt .75pt .75pt'>
  <p class=MsoNormal><font size=3 color=black face="Times New Roman"><span
  style='font-size:12.0pt'>*********************************************************************************************************************************************************************<br>
  &quot;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">administrator@birlasoft.com</a>)
  and permanently delete this message and any attachments. Thank you.&quot;<br>
  *********************************************************************************************************************************************************************<o:p></o:p></span></font></p>
  </td>
 </tr>
</table>

<pre wrap=""><font size=2 color=black face="Courier New"><span
style='font-size:10.0pt'><o:p>&nbsp;</o:p></span></font></pre><pre
style='text-align:center'><font size=2 color=black face="Courier New"><span
style='font-size:10.0pt'>

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

</span></font></pre><pre><font size=2 color=black face="Courier New"><span
style='font-size:10.0pt'><o:p>&nbsp;</o:p></span></font></pre><pre><font
size=2 color=black face="Courier New"><span style='font-size:10.0pt'>_______________________________________________<o:p></o:p></span></font></pre><pre><font
size=2 color=black face="Courier New"><span style='font-size:10.0pt'>mapguide-users mailing list<o:p></o:p></span></font></pre><pre><font
size=2 color=black face="Courier New"><span style='font-size:10.0pt'><a
href="mailto:mapguide-users@lists.osgeo.org">mapguide-users@lists.osgeo.org</a><o:p></o:p></span></font></pre><pre><font
size=2 color=black face="Courier New"><span style='font-size:10.0pt'><a
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
size=2 color=black face="Courier New"><span style='font-size:10.0pt'>&nbsp; <o:p></o:p></span></font></pre>

<p class=MsoNormal><font size=3 color=black face="Times New Roman"><span
style='font-size:12.0pt'><o:p>&nbsp;</o:p></span></font></p>

</div>

</body>

</html>

<table><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 (administrator@birlasoft.com) and permanently delete this message and any attachments. Thank you."<br>
*********************************************************************************************************************************************************************<br>
</font></td></tr></table>