Help with Hyperlink Column!

J

Jack Black

Hi, all!

I'm trying to build a hyperlink column who textField is one column in
the query, but whose URL needs to dyunamically contain the data from
another.

For example, I want to display a book title (column = "Title"), but
the URL needs to be:
myPage.aspx?book=ISBN (where ISBN is a column name)

Tried a few different approaches, but can't get there... Suggestions?

Jack
 
J

Jos

Jack said:
Hi, all!

I'm trying to build a hyperlink column who textField is one column in
the query, but whose URL needs to dyunamically contain the data from
another.

For example, I want to display a book title (column = "Title"), but
the URL needs to be:
myPage.aspx?book=ISBN (where ISBN is a column name)

Tried a few different approaches, but can't get there... Suggestions?

Jack

I would suggest converting the hyperlink column into a template column:
<TemplateColumn>
<ItemTemplate>
<a href='<%# String.Concat("myPage.aspx?book=",
DataBinder.Eval(Container.DataItem,"ISBN")) %>'>
<%# DataBinder.Eval(Container.DataItem,"Title") %>
</a>
</ItemTemplate>
</TemplateColumn>
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,773
Messages
2,569,594
Members
45,122
Latest member
VinayKumarNevatia_
Top