GridView Hyperlink Field Append URL?

Discussion in 'ASP .Net' started by barkster, Oct 11, 2006.

  1. barkster

    barkster Guest

    I'm trying to create a link in my gridview that will include th
    existing url parameters plus the ID of the field. I've trie
    everything I can think of to get it to work but this was my lates
    attempt below. I'm new to using asp.net and I'm just used t
    building my own url's in php and this is just so different the wa
    they go about it. I've tried about 5 different processes

    <asp:HyperLinkField DataNavigateUrlFields="WONo
    DataNavigateUrlFormatString="Detail.aspx?StartDate=<%
    Request.QueryString("StartDate"
    %>&amp;EndDate=<%
    Request.QueryString("EndDate"
    %>&amp;WO={0}"DataTextField="WONo
    /

    ---------------------------------
    http://community.ihostasp.ne
    ASP.NET Developer Community
     
    barkster, Oct 11, 2006
    #1
    1. Advertisements

  2. barkster

    Siva M Guest

    You can try TemplateField instead:

    ....
    <Columns>
    <asp:TemplateField>
    <ItemTemplate>
    <a href='<%# "default.aspx?StartDate=" +
    Request.QueryString["StartDate"] + "&EndDate=" +
    Request.QueryString["EndDate"] + "&wo=" +
    DataBinder.Eval(Container.DataItem, "WONo") %>'>
    <%# DataBinder.Eval(Container.DataItem, "WONo") %>
    </a>
    </ItemTemplate>
    </asp:TemplateField>
    ....
    </Columns>

    "barkster" <-spam.invalid> wrote in message
    news:...
    I'm trying to create a link in my gridview that will include the
    existing url parameters plus the ID of the field. I've tried
    everything I can think of to get it to work but this was my latest
    attempt below. I'm new to using asp.net and I'm just used to
    building my own url's in php and this is just so different the way
    they go about it. I've tried about 5 different processes.


    <asp:HyperLinkField DataNavigateUrlFields="WONo"
    DataNavigateUrlFormatString="Detail.aspx?StartDate=<%#
    Request.QueryString("StartDate")
    %>&amp;EndDate=<%#
    Request.QueryString("EndDate")
    %>&amp;WO={0}"DataTextField="WONo"
    />


    ----------------------------------
    http://community.ihostasp.net
    ASP.NET Developer Community
     
    Siva M, Oct 12, 2006
    #2
    1. Advertisements

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. Carlos
    Replies:
    1
    Views:
    9,445
    PeterKellner
    Jun 8, 2006
  2. =?Utf-8?B?UnV5IENhc3RlbGxp?=

    Retrieve information from Hyperlink and Button field on a GridView

    =?Utf-8?B?UnV5IENhc3RlbGxp?=, Oct 18, 2006, in forum: ASP .Net
    Replies:
    0
    Views:
    570
    =?Utf-8?B?UnV5IENhc3RlbGxp?=
    Oct 18, 2006
  3. HYRY
    Replies:
    10
    Views:
    838
    Bruno Desthuilliers
    Sep 26, 2007
  4. John
    Replies:
    4
    Views:
    517
    Munna
    Jun 2, 2008
  5. Bogdan
    Replies:
    2
    Views:
    2,090
    Alexey Smirnov
    Jul 20, 2009
  6. 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:
    264
    Alberto Teixeira
    Jul 29, 2004
  7. Dmitry N.Ananyev

    May I disable underline in one gridview Hyperlink field ?

    Dmitry N.Ananyev, Jun 29, 2005, in forum: ASP .Net Datagrid Control
    Replies:
    1
    Views:
    369
    Jagdish
    Jul 1, 2005
  8. RJ
    Replies:
    1
    Views:
    258
    JeffP@Work
    Sep 12, 2006
Loading...