DataGrid HyperLinkColumn question

B

Baris Seker

Hi all,

What I'm trying to do feels like very simple but I can't seem to do it. I
have a datagrid control and the first column is a HyperLink column; a link
to another page that includes variable that retrieved from the db. The html
view of this is below:

<asp:HyperLinkColumn DataNavigateUrlField="message_id"
DataNavigateUrlFormatString="editmessages.aspx?message_id={0}"
DataTextField="message_id" HeaderText="Message Id"
NavigateUrl="editmessages.aspx"></asp:HyperLinkColumn>

It's working as it is, passing the message_id to the other page. What I want
to do is to include another variable in there, which is the value of a text
box on the first page. So the URL to open should be like
.../editmessages.aspx?message_id=1&message_from=blah. How can I do this? How
can I insert the textbox1.text value in the hyperlinkcolumn field?

Thanks in advance!

Baris
 
G

Giorgio Parmeggiani

Hi

Unfortunately the "DataNavigateUrlFormatString" admits only a parameter!
What I want to do is to include another variable in there, which is the value of a text
box on the first page. So the URL to open should be like
../editmessages.aspx?message_id=1&message_from=blah. How can I do this?
How can I insert the textbox1.text value in the hyperlinkcolumn field?
Then to insert the second value you have two possibilities:

1) Use a TemplateColumn instead of HyperLinkColumn
2) At the ItemDataBound event find and modify the iperlink adding the
TextBox.Text

Hi
 

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

No members online now.

Forum statistics

Threads
473,756
Messages
2,569,540
Members
45,024
Latest member
ARDU_PROgrammER

Latest Threads

Top