Select to view content in your preferred language

query on startup

693
2
01-16-2014 05:55 PM
NathalieNeagle
Regular Contributor
I'm looking for a silverlight example similar to this JS example

I want to query a featrue before my map starts and select it and zoom to it.  The parameter would be in the url like:

http://myserver/myapp/myqueryfield=myvale

The map would load and zoom and select the feature.  I would pass in different values by changing the myvalue in the URL.

Does anyone know of a Silverlight example like this?

https://developers.arcgis.com/en/javascript/jssamples/query_click.html


THnaks
Nathalie
0 Kudos
2 Replies
BrentHoskisson
Frequent Contributor
Silverlight has an interface to communicate with its container Html page.  To get an argument from the query string you can use:

Dictionary<string, string> urlparams = (Dictionary<string, string>)HtmlPage.Document.QueryString;


(HtmlPage is from System.Windows.Browser)

Once there just grab the parameter you want and send it off to your map query and zoom function.

Good Luck
0 Kudos
ShilpiJain1
Deactivated User
You will need to write the query after InitializeComponent, which will work similar to the function initFunctionality() mentioned in JS example.

public MainPage()
{
    InitializeComponent();

   //your query
}
0 Kudos