Adding EVAL to asp:HyperLink NavigateUrl Tag

Posted on 2009-12-26
Last Modified: 2012-05-08
I want to do this

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

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

If I do this...

 NavigateUrl="javascript:var'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.

Question by:revstudio
    LVL 11

    Expert Comment

    Hello revstudio,

    Maybe you could try something like this:

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

    It might happen that you have to change a little bit, but something like that could help you.
    LVL 29

    Expert Comment

    by:Kumaraswamy R
    LVL 29

    Accepted Solution


    Author Closing Comment

    <script type="text/javascript">
        function showDoffDetails(doffID) {
  "fbtro.aspx?doff=" + doffID, "",

                                    <%# Eval("lngDoffID") %>

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Training Course: Adobe Dreamweaver CC 2015

    Adobe Dreamweaver Creative Cloud is used by web designers and front-end developers and allows you to visualize your site in real-time as you code. This course covers exam objectives for the Adobe Certified Associate (ACA) certification.

    Someone recently asked me about how to display a progress indicator on a page while an iframe is loading. And I remember when I first came across this myself. It was a bit tricky to get my head around, but really, it's very simple. The most impor…
    Use these top 10 tips to master the art of email signature design. Create an email signature design that will easily wow recipients, promote your brand and highlight your professionalism.
    The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.
    The viewer will receive an overview of the basics of CSS showing inline styles. In the head tags set up your style tags: (CODE) Reference the nav tag and set your properties.: (CODE) Set the reference for the UL element and styles for it to ensu…

    737 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    18 Experts available now in Live!

    Get 1:1 Help Now