Eval Hyperlink

Can someone tell me why this isn't working?

<a href="resortDetail.aspx?id='<%# Eval("ResortID") %>'"
Larry Bristersr. DeveloperAsked:
Who is Participating?
 
Larry BristerConnect With a Mentor sr. DeveloperAuthor Commented:
Hey guys...
I made a basic meathead move...
The code above works...I had the wrong destination page referenced.  All I had to do also...was remove single quotes.

Here's final version...
<a href="resortDetail2.aspx?id=<%#Eval("ResortID")%>" class="galleryResortLink">View Details</a>

Should I split points pr request the issue be closed without objection?
0
 
Carl TawnSystems and Integration DeveloperCommented:
Where is ResortID supposed to be coming from?
0
 
nmarunCommented:
That's right. Can you please post the entire code.. both aspx and the code-behind?
0
Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

 
burakiewiczCommented:
try this
<a href='<%#= "resortDetail.aspx?id=" + Eval("ResortID") %>' ></a>
0
 
EspavoCommented:
Have you tried:
<a href='<%# "resortDetail.aspx?id=" & Eval("ResortID") %>'>  
or
<a href='<%= "resortDetail.aspx?id=" & Eval("ResortID") %>'>  
(I always get confused about the = / #... ;-) )
0
 
sm394Commented:
also post what error msg you getting
0
 
nmarunCommented:
Since you found out the solution yourself, you can assign points to your post and mark this issue for PAQ.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.