Repeater Question

  • Thread starter Thread starter tma
  • Start date Start date
T

tma

How do I accomplish something like the following:

<a href="http://myURL.com/ws/ISAPI.dll?item=<%# databinder.eval(Container,
"DataItem.ItemID")%>" target=_blank><%# databinder.eval(Container,
"DataItem.ItemID")%></a>

Interestingly, it works when I build it, but VS will not let me go to Design
mode with this HTML. I want to pass a parameter to via the URL and have the
hyperlink text equal to the variable as well.

Thanks.
 
tma said:
How do I accomplish something like the following:

<a href="http://myURL.com/ws/ISAPI.dll?item=<%# databinder.eval(Container,
"DataItem.ItemID")%>" target=_blank><%# databinder.eval(Container,
"DataItem.ItemID")%></a>

Interestingly, it works when I build it, but VS will not let me go to Design
mode with this HTML. I want to pass a parameter to via the URL and have the
hyperlink text equal to the variable as well.

Use single apostrophes to help distinguish between the two strings.

<a href='http://myURL.com/ws/ISAPI.dll?item=<%#
databinder.eval(Container, "DataItem.ItemID")%>' target=_blank><%#
databinder.eval(Container, "DataItem.ItemID")%></a>

See how I used ' around the href, and " around the second parameter in
DataBinder.Eval()?


--

Scott Mitchell
(e-mail address removed)
http://www.4GuysFromRolla.com

* When you think ASP.NET, think 4GuysFromRolla.com!
 
Back
Top