<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> </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 “Invoke URL”<BR>command, passing “$Current Selection” to my “listdwfparcels.aspx” page,<BR>through the key & value pair.<BR><BR>I don’t know what I’m doing wrong, getting unclassified exception<BR>“MgSelection.FromXml” . . .<BR><BR>Checking the value of my mgkey content “$Current Selection” 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’m using –<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> <BR> <BR> try<BR> {<BR> InitializeWebTier();<BR><BR> MgUserInformation userInfo = new MgUserInformation(mgSessionId);<BR> MgSiteConnection siteConnection = new MgSiteConnection();<BR> siteConnection.Open(userInfo);<BR><BR> MgResourceService resourceService =<BR>siteConnection.CreateService(MgServiceType.ResourceService) as<BR>MgResourceService;<BR> MgFeatureService featureService =<BR>siteConnection.CreateService(MgServiceType.FeatureService) as<BR>MgFeatureService;<BR> MgFeatureQueryOptions queryOptions = new MgFeatureQueryOptions();<BR> <BR> MgMap map = new MgMap();<BR> map.Open(resourceService, "HaifaMap");<BR> <BR>if (GetParameters()["SESSION"] != "")<BR>{<BR> selection = new MgSelection(map, mgSelection);<BR><BR><<<<< MY ERROR >>>>><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 – 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>