Adding EVAL to asp:HyperLink NavigateUrl Tag

Posted on 2009-12-26
Medium Priority
Last Modified: 2012-05-08
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')"
                                <%# Eval("lngDoffID") %>

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.

Question by:revstudio
  • 2
LVL 11

Expert Comment

ID: 26125767
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')"
                                <%# 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
ID: 26126135
LVL 29

Accepted Solution

Kumaraswamy R earned 750 total points
ID: 26126147

Author Closing Comment

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

                                <%# Eval("lngDoffID") %>

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

When it comes to write a Context Sensitive Help (an online help that is obtained from a specific point in state of software to provide help with that state) ,  first we need to make the file that contains all topics, which are given exclusive IDs. …
Without even knowing it, most of us are using web applications on a daily basis.  In fact, Gmail and Yahoo email, Twitter, Facebook, and eBay are used by most of us daily—and they are web applications. We generally confuse these web applications to…
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.
Video by: Mark
This lesson goes over how to construct ordered and unordered lists and how to create hyperlinks.
Suggested Courses

862 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