Link to home
Start Free TrialLog in
Avatar of revstudio
revstudioFlag for United States of America

asked on

Adding EVAL to asp:HyperLink NavigateUrl Tag

I want to do this

<asp:HyperLink runat ="server"
                                NavigateUrl="javascript:var w=window.open('fbtro.aspx?doff= <%# Eval("lngDoffID") %>','', 'width=625,height=500,scrollbars=0,resizeable=0')"
                                ID="Hyperlink1">
                                <%# Eval("lngDoffID") %>
                            </asp:HyperLink>

and NavigateUrl doesn't like the embedded <%# Eval("lngDoffID") %>

If I do this...

 NavigateUrl="javascript:var w=window.open('fbtro.aspx','', 'width=625,height=500,scrollbars=0,resizeable=0')"

it will open fbtro.aspx just like I want but with the Eval in there I get a 'server tag not well formed'

I can't figure out how to "form" it ?

Thanks in advance.

Avatar of nordtorp
nordtorp
Flag of Norway image

Hello revstudio,

Maybe you could try something like this:

<asp:HyperLink runat ="server"
                                NavigateUrl="javascript:var w=<%#('"window.open('" + "fbtro.aspx?doff=" + Eval("lngDoffID") +"') %>','', 'width=625,height=500,scrollbars=0,resizeable=0')"
                                ID="Hyperlink1">
                                <%# Eval("lngDoffID") %>
                            </asp:HyperLink>

It might happen that you have to change a little bit, but something like that could help you.
Avatar of Kumaraswamy R
ASKER CERTIFIED SOLUTION
Avatar of Kumaraswamy R
Kumaraswamy R
Flag of India image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of revstudio

ASKER

<script type="text/javascript">
    function showDoffDetails(doffID) {
        window.open("fbtro.aspx?doff=" + doffID, "",
        "toolbar=0,width=800,height=600,scollbars=0,resizeable=0");
    }
</script>

 
                                <%# Eval("lngDoffID") %>