I am working on developing a web app application for our campus (Information navigation system) using ArcGIS API for java scripts. Our application should run similar to google maps, so where ever I click on our map, it should take the nearest road and show the shortest route between two points. I think the problem is with the network dataset I created in ArcMap because our code has no errors but still it's not working like it's not giving the shortest path between any two points on the map. Our network dataset contains information about "roads" but the remaining space has no information, should we give any? If yes, how to give so that when we publish our service(NA server), we meet our requirements.
I would load your network dataset directly into arcmap, and solve routes for it there. That will take your web application out of the equation. If it is still not displaying the shortest route, then you know that is either related to the data or the configuration of the network dataset.