?
Solved

javascript get sql data

Posted on 2010-03-26
5
Medium Priority
?
452 Views
Last Modified: 2012-05-09
Hi,

I know this is an easy one for someone in the know, so heres the scenario:

Building a small address book/ organiser type site.
Top level of this is a list of addresses
When an address is clicked on we go to the organiser page (using the ID as a qrystring) that has an upload/ download file, todo list, pic viewer and google map with street view.
Got this all working fine, but want the map to auto centre on the address that is relevant.
the page loads with ?AutoID=X so I want to use this var to pull the address so I can geocode it. Baseing the query on this ID will guarantee only 1 record returned.
Ive tried to hold the value in a datagrid and pull it into javascript using document.getElementbyID('<%# gmaps_add %>') and entbyID('<%# gmaps_add{0} %>') but I just dont know enough to think my way out of this one,

If possible, as well as the answer Id love to understand whats happening logic wise.

Thanks

DaveP
0
Comment
Question by:gingermoleman
  • 3
  • 2
5 Comments
 
LVL 4

Accepted Solution

by:
Pacemaker9007 earned 1000 total points
ID: 28916231
Hi DaveP, you can find a nice example here> http://www.netomatix.com/development/gridviewclientsideaccess.aspx. or you can get the values from the gridview in codebehind and save them in a cookie, which can be used in javascript
0
 
LVL 5

Author Closing Comment

by:gingermoleman
ID: 31707557
Nice find, the 2 associated articles were also extremely useful
0
 
LVL 5

Author Comment

by:gingermoleman
ID: 29220803
Solution from the links is somewhat incomplete. Im unsure as to why (poss update to HTMLTableElement from asp2 to 3.5??), but was constantly getting 'undefined' as the response. Having played about I found that by ammending function getCellValue to
return gridCell.firstChild.nodeValue;
instead of innerText, it pulls the content correctly
0
 
LVL 4

Expert Comment

by:Pacemaker9007
ID: 29221908
I think that innerText does not work in Firefox, only IE, sorry for not mentioning that.
0
 
LVL 5

Author Comment

by:gingermoleman
ID: 29224246
aaah, fair enough. Thanks for settling that one for me
0

Featured Post

2018 Annual Membership Survey

Here at Experts Exchange, we strive to give members the best experience. Help us improve the site by taking this survey today! (Bonus: Be entered to win a great tech prize for participating!)

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Article by: DanRollins
This article describes a JavaScript program that creates a maze made of hexagonal cells.  In Part 2 (http://www.experts-exchange.com/Programming/Languages/Scripting/JavaScript/A_7850-Hex-Maze-Part-2.html), we'll extend the program by adding a depth-…
Boost your ability to deliver ambitious and competitive web apps by choosing the right JavaScript framework to best suit your project’s needs.
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…
Suggested Courses

588 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question