I'm building a map that shows sites (points) connected by conduits (polylines). On the conduits, I have a popup template that shows some information about the conduit, as well as the names of the sites on either end of it. I want to make those site names links, so the user can click on them and the map will zoom/pan to the sites.
First off, let me state that this is my first time doing professional web development. I've written numerous services, and desktop applications for windows, linux and the JVM, but never really gotten into web development until now. I'm quite the newb at it. I do have some limited experience with a LAMP stack I used to make a site for my home network, but PHP is so much simpler and easier to use than asp.net, which is what I have to build this site in.
I've tried calling map.goTo() and passing it the appropriate graphic and/or point, but the map just doesn't respond. The console tells me that the object "map" is not defined, so apparently I'm out of scope. It's occurred to me that this might be due to the location of the script element (see my last paragraph). I considered defining an event handler that would be compiled while still in scope and hopefully continue listening, but I can't find a way to pass the argument (the name of the site) back to the event handler when raising the event.
One curious thing I've found is that I can't get any of the javascript to run properly if I embed it directly in the head or in the body of the page. Instead, I have to write a <script></script> element directly to the top of the page (above even the <!DOCTYPE> tag) in order for the javascript to run. I'm currently looking into that, as I suspect it's something to do with asp.net not allowing the script to run, but truth be told, I really don't know what is causing it. I do know that when I hand-write an html file with an ArcMap script in the header, that runs just fine. I can't write static pages, though. I need the page to get the info from a database every time it's loaded or refreshed.
Any help would be greatly appreciated.