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. Advertising

  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. 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. Carlos
    Replies:
    1
    Views:
    8,989
    PeterKellner
    Jun 8, 2006
  2. HYRY
    Replies:
    10
    Views:
    646
    Bruno Desthuilliers
    Sep 26, 2007
  3. John
    Replies:
    4
    Views:
    424
    Munna
    Jun 2, 2008
  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:
    180
    Alberto Teixeira
    Jul 29, 2004
  5. Dave
    Replies:
    0
    Views:
    455
Loading...

Share This Page