Link to home
Start Free TrialLog in
Avatar of tcottrill
tcottrill

asked on

Appending Query String Value to URL in Gridview HyperlinK Field

Here's my issue. I'm passing a value to the page called degree IIe: page.aspx?degree=1

and I need to append it to the NavigateURL value of a hyperlink field in a Gridview.

I've thrown everything at it I can think of. Thanks in advance for your help.  
<asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" 
            CellPadding="4" DataKeyNames="InterestID" DataSourceID="SqlDataSource1" 
            ForeColor="#333333" GridLines="None">
            <RowStyle BackColor="#E3EAEB" />
            <Columns>
...                <asp:HyperLinkField NavigateUrl="DegreesToInterest.aspx" 
                    Text="ManageInterests" />
            </Columns>
...
        </asp:GridView>

Open in new window

Avatar of Lotok
Lotok
Flag of United Kingdom of Great Britain and Northern Ireland image

Markup

<asp:HyperLinkField NavigateUrl='<%# value() %>' Text="ManageInterests" />


Code Behind

Public Property Value() as string


Then assign the url into the value property. Hope that makes sense. :)
ASKER CERTIFIED SOLUTION
Avatar of guru_sami
guru_sami
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial