<HTML dir=ltr><HEAD><TITLE>[mapguide-users] Listing Active selected feature C#</TITLE>
<META http-equiv=Content-Type content="text/html; charset=unicode">
<META content="MSHTML 6.00.5730.11" name=GENERATOR></HEAD>
<BODY>
<DIV id=idOWAReplyText41468 dir=ltr>
<DIV dir=ltr><FONT face=Arial color=#000000 size=2>I have a C# example where I am doing exactly this. I can send you the page via separate means if you are interested.</FONT></DIV>
<DIV dir=ltr><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV dir=ltr><FONT face=Arial size=2>Greg</FONT></DIV></DIV>
<DIV dir=ltr><BR>
<HR tabIndex=-1>
<FONT face=Tahoma size=2><B>From:</B> mapguide-users-bounces@lists.osgeo.org on behalf of Nimrod Cnaan<BR><B>Sent:</B> Sat 1/20/2007 9:13 AM<BR><B>To:</B> mapguide-users@lists.osgeo.org<BR><B>Subject:</B> [mapguide-users] Listing Active selected feature C#<BR></FONT><BR></DIV>
<DIV><BR>
<P><FONT size=2>I am attempting to get the list of selected parcels by using &#8220;Invoke URL&#8221;<BR>command, passing &#8220;$Current Selection&#8221; to my &#8220;listdwfparcels.aspx&#8221; page,<BR>through the key &amp; value pair.<BR><BR>I don&#8217;t know what I&#8217;m doing wrong, getting unclassified exception<BR>&#8220;MgSelection.FromXml&#8221; . . .<BR><BR>Checking the value of my mgkey content &#8220;$Current Selection&#8221; returns:<BR><BR>%3C%3Fxml%20version%3D%221.0%22%20encoding%3D%22UTF-8%22%3F%3E%0A%3CFeatureSet%3E%0A%3CLayer%20id%3D%22d6a8101a-ffff-ffff-8003-000000000038%22%3E%0A%3CClass%20id%3D%22Default%3AHelkot%22%3E%0A%3CID%3ETAAAAA%3D%3D%3C%2FID%3E%0A%3CID%3EVwAAAA%3D%3D%3C%2FID%3E%0A%3CID%3EVgAAAA%3D%3D%3C%2FID%3E%0A%3C%2FClass%3E%0A%3C%2FLayer%3E%0A%3C%2FFeatureSet%3E%0A<BR><BR>Here is portion of the code that I&#8217;m using &#8211;<BR><BR>String mgSessionId = GetParameters()["SESSION"];<BR>String mgSelection = GetParameters()["mgkey"];<BR>MgResourceIdentifier layerFeatureResource;<BR>MgReadOnlyLayerCollection layers;<BR>MgSelection selection;<BR>MgLayer layer;<BR>string layerClassName;<BR>string selectionString;<BR>string layerFeatureId;<BR>&nbsp;<BR>&nbsp;<BR>&nbsp;try<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {<BR>&nbsp; InitializeWebTier();<BR><BR>&nbsp; MgUserInformation userInfo = new MgUserInformation(mgSessionId);<BR>&nbsp; MgSiteConnection siteConnection = new MgSiteConnection();<BR>&nbsp; siteConnection.Open(userInfo);<BR><BR>&nbsp; MgResourceService resourceService =<BR>siteConnection.CreateService(MgServiceType.ResourceService) as<BR>MgResourceService;<BR>&nbsp; MgFeatureService featureService =<BR>siteConnection.CreateService(MgServiceType.FeatureService) as<BR>MgFeatureService;<BR>&nbsp; MgFeatureQueryOptions queryOptions = new MgFeatureQueryOptions();<BR>&nbsp;&nbsp;<BR>&nbsp; MgMap map = new MgMap();<BR>&nbsp; map.Open(resourceService, "HaifaMap");<BR>&nbsp;&nbsp;<BR>if (GetParameters()["SESSION"] != "")<BR>{<BR>&nbsp;&nbsp;&nbsp; selection = new MgSelection(map, mgSelection);<BR><BR>&lt;&lt;&lt;&lt;&lt; MY ERROR &gt;&gt;&gt;&gt;&gt;<BR>An unclassified exception occurred.An unclassified exception occurred.<BR>Exception occurred in method MgSelection.FromXml at line 158 in file<BR>c:\build_tux_area\mgdev_opensource\common\service\maplayer\Selection.cpp<BR><BR><BR>Nimrod Cnaan &#8211; GIS Senior Programmer<BR>Haifa Municipality, Israel<BR>Phon:972525355483<BR><BR>--<BR>View this message in context: <A href="http://www.nabble.com/Listing-Active-selected-feature-C--tf3045397s16610.html#a8465318">http://www.nabble.com/Listing-Active-selected-feature-C--tf3045397s16610.html#a8465318</A><BR>Sent from the MapGuide Users mailing list archive at Nabble.com.<BR><BR>_______________________________________________<BR>mapguide-users mailing list<BR>mapguide-users@lists.osgeo.org<BR><A href="http://lists.osgeo.org/mailman/listinfo/mapguide-users">http://lists.osgeo.org/mailman/listinfo/mapguide-users</A><BR></FONT></P></DIV></BODY></HTML>

<HTML><BODY><P><hr size=1></P><br>
<P><STRONG><br>
The substance of this message, including any attachments, may be<br>
confidential, legally<br>
privileged and/or exempt from disclosure pursuant to Massachusetts<br>
law. It is intended<br>
solely for the addressee. If you received this in error, please<br>
contact the sender and<br>
delete the material from any computer.<br>
</STRONG></P></BODY></HTML>