Reputation: 427
Here is my scenario:
All the above is pretty straight forward ESRI JavaScript API – now I am hitting a bit of a crossroads in approaches and I am wondering if you have an approach you use for the following:
I have the road segment ID in a variable on the client side in JavaScript. I need this ID to query a database table in sql server.
The query is pretty simple
SELECT Library FROM DataTable WHERE Road_ID = x
It is just a database table not geodatabase. The returned data will only be one record and one attribute - the closest Library. I will use the returned data to continue on in the JavaScript API.
So I have an idea of how to proceed but I am not sure it is the smartest way to go. My tool set is ASP.NET, C#, Dojo, ESRI JavaScript API and JavaScript:
Upvotes: 0
Views: 1472
Reputation: 14041
I think you're making things way too complicated with Client Callback.
Create an Web Handler that returns the record as JSON or XML and make the road ID a querystring parameter of the Handler.
Call the handler via an AJAX call from within your JavaScript.
Upvotes: 1