Hi!<div><br></div><div>I&#39;m trying to highlight features in the map based on querystring variables. </div><div>I.e surfing to <a href="http://url.to.server?value=123456&amp;field=FNR" target="_blank">http://url.to.server?value=123456&amp;field=FNR</a> should highlight features with FNR=123456.</div>

<div><br></div><div>Server-side logic as follows (C#, <a href="http://asp.net" target="_blank">asp.net</a> 2.0, in Default.aspx.cs, Page_Load-function):</div><div><br></div><div><div>if (!IsPostBack) {</div><div><br></div>
<div>                if (Request.QueryString.Count &gt; 0) {</div>
<div>                    string sessId = Session[&quot;MapGuideSessId&quot;] as string;</div><div>                    MgSiteConnection siteConn = new MgSiteConnection();</div><div>                    siteConn.Open(new MgUserInformation(sessId));</div>

<div>                    string mapName = &quot;MapName&quot;;</div><div>                    MgMap map = new MgMap(siteConn);</div><div><br></div><div>                    /* Need to create a new map? </div><div>                    map.Create(new MgResourceIdentifier(&quot;Library://mapname/Mapname.MapDefinition&quot;), mapName);</div>

<div>                    map.Save();</div><div>                    map.Open(siteConn.CreateService(MgServiceType.ResourceService) as MgResourceService, mapName);</div><div>                    */</div><div><br></div><div>
                    map.Open(siteConn.CreateService(MgServiceType.ResourceService) as MgResourceService, mapName);</div>
<div>                    MgLayerBase layer = map.GetLayers().GetItem(0);</div><div>                    StringBuilder query = new StringBuilder();</div><div>                    MgFeatureQueryOptions queryOptions = new MgFeatureQueryOptions();</div>

<div><br></div><div>                    /*Constructing up a selection string. Don&#39;t mind this. */</div><div>                    string filterField = GetQueryStringValue(&quot;field&quot;);</div><div>                    string value = GetQueryStringValue(&quot;value&quot;);</div>

<div>                    string[] filterVal = value.Split(&#39;|&#39;);</div><div><br></div><div>                    int fnrLen = filterVal.Length;</div><div><br></div><div>                    for (int i = 0; i &lt; fnrLen; i++) {</div>

<div>                        if (i &lt; fnrLen - 1)</div><div>                            query.Append(string.Format(&quot;{0} = {1} or&quot;, filterField, filterVal[i]));</div><div>                        else</div><div>

                            query.Append(string.Format(&quot;{0} = {1}&quot;, filterField, filterVal[i]));</div><div>                    }</div><div>                    </div><div>                    queryOptions.SetFilter(query.ToString());</div>

<div><br></div><div>                    MgFeatureReader reader = layer.SelectFeatures(queryOptions);</div><div>                    MgSelection selection = new MgSelection(map);</div><div>                    selection.AddFeatures(layer, reader, 0);</div>

<div>                    _selectionXml = selection.ToXml();</div><div>                    selection.Save(siteConn.CreateService(MgServiceType.ResourceService) as MgResourceService, mapName);</div><div>                }</div>

<div>                else {</div><div>                    // Utils-class sets up and creates session</div><div>                    utils = new Utils(Request.ServerVariables[&quot;APPL_PHYSICAL_PATH&quot;]);</div><div>                    // Store session globally</div>

<div>                    Session[&quot;MapGuideSessId&quot;] = utils.SessionID;</div><div>      </div><div>            }</div></div><div><br></div><div>When I run this code nothing gets highlighted in the map at all. I&#39;ve debugged the code to make sure that the query works as intended and it does. I&#39;m guessing that my problem has something to do with the map but I can&#39;t figure out what&#39;s wrong.</div>

<div>I&#39;m using pretty much the same code when creating a selection from the taskpane and that works like a charm.</div><div>I&#39;ve been struggeling with this for several days now and I&#39;d be very glad if someone could help me, or at least point me in the right direction. </div>

<div>Thank you!</div><div><br></div><div>Regards,</div><div>Andreas</div><div><br></div>