DataGrid HyperLinkColumn question

Discussion in 'ASP .Net Datagrid Control' started by Baris Seker, Oct 27, 2003.

  1. Baris Seker

    Baris Seker Guest

    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
     
    Baris Seker, Oct 27, 2003
    #1
    1. Advertising

  2. 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
     
    Giorgio Parmeggiani, Nov 1, 2003
    #2
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. vtreddy
    Replies:
    0
    Views:
    2,069
    vtreddy
    Nov 6, 2003
  2. =?Utf-8?B?RGF2ZQ==?=

    Can't apply CSS class to DataGrid's HyperlinkColumn?

    =?Utf-8?B?RGF2ZQ==?=, Feb 27, 2004, in forum: ASP .Net
    Replies:
    1
    Views:
    2,071
    Martin Dechev
    Feb 27, 2004
  3. Rob Meade

    Datagrid - HyperLinkColumn

    Rob Meade, Aug 9, 2004, in forum: ASP .Net
    Replies:
    0
    Views:
    585
    Rob Meade
    Aug 9, 2004
  4. Replies:
    2
    Views:
    3,467
  5. Mike C

    asp:hyperlinkcolumn Datagrid question...

    Mike C, Sep 9, 2003, in forum: ASP .Net Web Controls
    Replies:
    0
    Views:
    123
    Mike C
    Sep 9, 2003
Loading...

Share This Page