Results 1 to 6 of 6
  1. #1
    Join Date
    Feb 2004
    Posts
    104

    Unanswered: Running Vbscript on a Link

    How can I run vbscript in my asp application when a user clicks on a link?

  2. #2
    Join Date
    Jun 2003
    Location
    USA
    Posts
    1,032
    Links are harder to control since they are by nature so client-oriented. But of course you could make the link include some kind of querystring that gets acted upon by the page that gets opened which might be the final page that gets opened or might be in intermediate page that further redirects the user.
    J. Paul Schmidt, Freelance Web and Database Developer
    www.Bullschmidt.com
    Access Database Sample, Web Database Sample, ASP Design Tips

  3. #3
    Join Date
    Dec 2003
    Posts
    454
    In your link, you can call a JavaScript which calls a VBScript located in an ASP file.

  4. #4
    Join Date
    Jan 2005
    Posts
    36
    You are confusing where asp runs.

    vbscript (asp) cannot do anything in the browser directly. All it can do is change what is sent to the browser when the asp page is requested. Once the user has the page on his screen - he has no interaction with the asp code that created the page. The asp code only spits out html pages that are sent to the browser. ASP can dynamically change the html code before it is sent - populating fields from a db for example, or re-writing the actual html / css / javascript to suit.

    So, on a link - you can call another asp page using a link - but nothing can run actually on the users browser. ASP runs on the web server only.

    So the squence of events are

    1. browser requests an asp page. Maybe the request includes form field data etc.
    2. server runs the asp page and then dynmaically creates the html output
    3. server sends this html to the browser
    4. browser displays it on the screen. If the page has say javascript in it - this can run on the browser (on pc machine looking at the web page)

  5. #5
    Join Date
    Dec 2003
    Posts
    454
    I think that you misunderstood what I mean. Here is an example. There is an email link. When an user clicks on it your Outlook Express (or other email window) will be popped up. You can compose an email, but at the same time, you need to store data into your table. How can you do it? You can use a JavaScript to call a VBScript in an ASP file which is located on the server. That is the possibility to do that.

  6. #6
    Join Date
    Jan 2005
    Posts
    36
    Sorry - I meant non linear is miss-understanding where ASP runs, not you. I agreed with your post. My bad - I should have been clearer in my post.

Posting Permissions

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