Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    New Coder
    Join Date
    Aug 2003
    Posts
    82
    Thanks
    0
    Thanked 0 Times in 0 Posts

    problem with onclick

    Hello, in a iframe, I've a list of links on a page. witch one loads db record on a page in the same window where iframe is.
    iframe is in "main" window.

    this code works well

    <a href="xpto.asp?test=<%&rs("nuser")&%>" target="main" style="width:45; text-align:center;"><%&rs("nuser")&%></a>

    this code dosn't work.

    <a href="" target="main" style="width:45; text-align:center;" onClick="javascript:window.location.href=xpto.asp?test=<%&rs("nuser")&%>"> <%&rs("nuser")&%> </a>

    ie return this: "Directory Listing Denied. This Virtual Directory does not allow contents to be listed."

    Please somebody....

  • #2
    Senior Coder Nightfire's Avatar
    Join Date
    Jun 2002
    Posts
    4,266
    Thanks
    6
    Thanked 48 Times in 48 Posts
    This is a javascript question, not asp.

    Code:
    <a href="" target="main" style="width:45; text-align:center;" onClick="javascript:window.location.href='xpto.asp?test=<%&rs("nuser")&%>'"> <%&rs("nuser")&%> </a>
    Need the single quotes around the url after href=

  • #3
    Senior Coder
    Join Date
    Jun 2002
    Location
    41 8' 52" N -95 53' 31" W
    Posts
    3,660
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Nightfire is right... but for clarity's sake I'm going to move this post to the JavaScript forum for any further questions.

    By the way, I usually use <% = variablename %> for inline ASP code... I've never seen the <% & variablename & %> syntax. Does that actually work? I'll have to try it later.
    Former ASP Forum Moderator - I'm back!

    If you can teach yourself how to learn, you can learn anything. ;)


  •  

    Posting Permissions

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