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

Forum statistics

Threads
473,994
Messages
2,570,223
Members
46,813
Latest member
lawrwtwinkle111

Latest Threads

Top