How to send multiple URL fields in Http Header using asp.net datagrid

Discussion in 'ASP .Net Datagrid Control' started by Kamal Ahmed, Jun 22, 2005.

  1. Kamal Ahmed

    Kamal Ahmed Guest

    Hi All,

    I have a problem with Asp.Net Datagrid. I have two 2 databound fields in
    Asp.Net Datagrid "Code" & "Name". I want to send values of both columns by
    clicking on (Code) URL field.
    e.g. Values should be sent to Http header like this:
    /pagename.aspx?code=01&name=Christopher

    How is it possible ?

    TIA
    Kamal Ahmed, Jun 22, 2005
    #1
    1. Advertising

  2. Kamal Ahmed

    Elton Wang Guest

    You can have a HyperLinkColumn in the datagrid. Then in
    datagrid_ItemDataBound event, you can assign url with query string for the
    HyperLink:

    if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == case
    ListItemType.AlternatingItem)
    {
    HyperLink link = (HyperLink)e.item.Cells[link_column_index].Controls[0];
    link.NavigateUrl = "/pagename.aspx?code=" +
    e.item.Cells[code_column_index].Text + "&name=" +
    e.item.Cells[name_column_index].Text;
    }


    HTH

    Elton Wang

    "Kamal Ahmed" <> wrote in message
    news:...
    > Hi All,
    >
    > I have a problem with Asp.Net Datagrid. I have two 2 databound fields in
    > Asp.Net Datagrid "Code" & "Name". I want to send values of both columns by
    > clicking on (Code) URL field.
    > e.g. Values should be sent to Http header like this:
    > /pagename.aspx?code=01&name=Christopher
    >
    > How is it possible ?
    >
    > TIA
    >
    >
    Elton Wang, Jun 22, 2005
    #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. =?Utf-8?B?Y2FybG9y?=

    Multiple URL Fields in a datagrid

    =?Utf-8?B?Y2FybG9y?=, Nov 24, 2004, in forum: ASP .Net
    Replies:
    1
    Views:
    2,966
    Joe Fallon
    Nov 25, 2004
  2. anonymous
    Replies:
    1
    Views:
    4,538
    Francisco Padron
    May 8, 2005
  3. hendy
    Replies:
    0
    Views:
    745
    hendy
    Dec 20, 2005
  4. Alberto Teixeira

    DataGrid HyperLink Column - How can I put multiple fields in the URL field

    Alberto Teixeira, Jul 29, 2004, in forum: ASP .Net Datagrid Control
    Replies:
    1
    Views:
    156
    Alberto Teixeira
    Jul 29, 2004
  5. hendy
    Replies:
    1
    Views:
    255
    Bob Barrows [MVP]
    Dec 20, 2005
Loading...

Share This Page