Sending values from server side to Client side javascript

Discussion in 'Javascript' started by Renuka, Nov 13, 2003.

  1. Renuka

    Renuka Guest

    Hello,

    Can someone help me with the following situation??

    I have a Hyperlink within a String like below:

    sSql = "SELECT DISTINCT " + "'Action' = '<center><a
    href='+char(34)+'ChangeRequest.aspx?ID='+cast(ChangeRequest.ChangeRequest_ID
    as nvarchar) +CHAR(34)+'>Open</a></center>',"

    I want to invoke a Client side javascript function and pass the value
    of the ID. How can I accomplish this such when a user clicks "Open" he
    goes to a new window with the same ID.

    I tried this but it does not work:
    On Server side:
    sSql = "SELECT DISTINCT " + "'Action' = '<center><a href= 'javascript:
    NewWindow('+cast(ChangeRequest.ChangeRequest_ID as nvarchar)+
    CHAR(34)+)'>Open</a></center>',"

    On Client side:
    function NewWindow(myID)
    {
    window.open("ChangeRequest.aspx?ID="+myID,"WindowName","width=500,height=600");
    }
    </script>
     
    Renuka, Nov 13, 2003
    #1
    1. Advertisements

  2. on 13/11/2003:
     
    Michael Winter, Nov 13, 2003
    #2
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.