Results 1 to 6 of 6
  1. #1
    3 Star Lounger
    Join Date
    Apr 2001
    Location
    Warrington, Cheshire
    Posts
    355
    Thanks
    3
    Thanked 0 Times in 0 Posts

    hyperlink response

    Currently have a datagrid with the first column contents set as hyperlink.
    The url is then directed to new page with one of the fields as the response. The array number is {0}
    e.g. newpage.aspx?id=zzz

    Q - can I add to the array and have the response send more than one field value .
    e.g. redirect the user to newpage.aspx?id=zzz&period=4

    I know I can simply add the string "&period=4", but I want to send one of the field values.

    TIA
    Alan

  2. #2
    Platinum Lounger
    Join Date
    Feb 2002
    Location
    A Magic Forest in Deepest, Darkest Kent
    Posts
    5,681
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: hyperlink response

    Hi Alan

    If you want to display links to other pages from your DataGrid, you can use a HyperLinkColumn to display the links. Then also use the DataTextFormatString to format it with the text you require to show
    Jerry

  3. #3
    3 Star Lounger
    Join Date
    Apr 2001
    Location
    Warrington, Cheshire
    Posts
    355
    Thanks
    3
    Thanked 0 Times in 0 Posts

    Re: hyperlink response

    Thanks Jerry,
    I am already using the hyperlink column, but my problem is that I can only include one response string with that link.
    e.g. my existing column is:
    <asp:HyperLinkColumn Target="_blank" DataNavigateUrlField="ClientGroup" DataNavigateUrlFormatString="GMClients.aspx?id={0} "
    DataTextField="ReportToName" SortExpression="reporttoname" HeaderText="Group
    Name" FooterText="Total">

    which would give me a typical redirection to:
    GMClients.aspx?id=zzz

    But I want to incllude a second field in the response to say:
    GMClients.aspx?id=zzz&ledger=6

    I think I may have to use a buttoncolumn but I'm not sure on the underlying code/sub for that

    Cheers
    Alan

  4. #4
    3 Star Lounger
    Join Date
    Apr 2001
    Location
    Warrington, Cheshire
    Posts
    355
    Thanks
    3
    Thanked 0 Times in 0 Posts

    Re: hyperlink response

    Solution was:
    insert an asp:buttoncolumn
    <asp:buttoncolumn CommandName="Test_command" runat="server" ButtonType="linkButton" ItemStyle-HorizontalAlign="center"
    ItemStyle-Font-Size="5" text="SELECT" Headertext="Drill
    down"></asp:buttoncolumn>
    and have the datagrid OnItemCommand run a sub which contains the command
    Response.Redirect(strURL)
    strURL being determined by which command you clicked.

    Only down side being that you cannot open a blank target window with this method.

    cheers
    Alan

  5. #5
    Silver Lounger
    Join Date
    Jan 2001
    Location
    Indianapolis, Indiana, USA
    Posts
    1,862
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: hyperlink response

    You can use a Template column to give you the custom functionality you need. The tradeoff is that it takes a bit more upfront effort to "wire-up" the template column to display as desired.

  6. #6
    3 Star Lounger
    Join Date
    Apr 2001
    Location
    Warrington, Cheshire
    Posts
    355
    Thanks
    3
    Thanked 0 Times in 0 Posts

    Re: hyperlink response

    Thanks Mark.
    I haven't done a great deal on Templates so I'll be spending a bit of time reading up and learning.
    If they can solve the link prob better than my current method then I'll give it a go.
    Cheers
    Alan

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •