Results 1 to 3 of 3

Thread: Javascript + ASP + MS SQL = Confused Me

  1. #1
    Join Date
    Sep 2005
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Javascript + ASP + MS SQL = Confused Me

    I have developed a javascript 'application' and have been using test data in it, it has come time to put a database behind it and I am having quite a bit more trouble than I intially imagined. I have spent a while trying to learn the difference between client-side and server-side, but still cannot bring it all together.

    My situation seems to be pretty basic. I want to read row by row through a database using ASP.net (VB.net) and call a javascript function that will creave divs on a page based on this information. My problem is that I cannot figure out how to pass the database information into the function.... ideas?

  2. #2
    Join Date
    Jun 2005
    Posts
    33
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Probably best to use something like ASP.net Maker:

    http://www.hkvstore.com/aspnetmaker/

    does most of the hard work for you.

  3. #3
    Join Date
    Jun 2005
    Location
    英国
    Posts
    11,876
    Thanks
    1
    Thanked 180 Times in 172 Posts
    Blog Entries
    2

    Default

    I can't give you specifics, as I don't know ASP, but when you're using a server-side language and a client-side language together, you would need to echo the values into the script directly. For example, if the database info was stored in an array called RowOne, you could do:
    Code:
    <script type="text/javascript">
    var RowOne = Array();
    <%
    For Each x In RowOne
      Response.Write("RowOne[" & x & "] = " & RowOne(x) & ";")
    Next
    %>
    </script>
    My syntax is probably all wrong, but you get the idea.
    Twey | I understand English | 日本語が分かります | mi jimpe fi le jbobau | mi esperanton komprenas | je comprends franšais | entiendo espa˝ol | t˘i Ýt hiểu tiếng Việt | ich verstehe ein bisschen Deutsch | beware XHTML | common coding mistakes | tutorials | various stuff | argh PHP!

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •