The HyperLinkColumn in datagrid?

G

Gavin Yu

Hello

I add a hyperlink column to the datagrid, this column populated with
messageID from DB. And the link is to messageDeail.aspx, and I want to bring
a perimeter messageNo with the value messageID( which is from database.

But I try the following code, the datagrid display right, the link
is"messageDetail.aspx?messageNo=<%=messageID%>", the messageID value is not
correct.

I don't know how to get it work. if you could please e-mail me at
(e-mail address removed) to let me know it would be deeply appreciated. Here is my
source code:


<Columns>

<asp:ButtonColumn Text="Detail" HeaderText="Detail"
CommandName="Detail"></asp:ButtonColumn>
<asp:HyperLinkColumn HeaderText="<b>MessageID</b>" runat='server'
DataTextField='messageID' DataNavigateUrlFormatString='messageID'
NavigateUrl="messageDetail.aspx?messageNo=<%=messageID%>" />
</Columns>
 
S

suzy

gavin, try something like this:
hclSubject.DataNavigateUrlField = "messageID";

hclSubject.DataNavigateUrlFormatString = "messageDetail.aspx?messageNo={0}";



let me know if it works
 

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,755
Messages
2,569,536
Members
45,010
Latest member
MerrillEic

Latest Threads

Top