troubleshooting Question

Gridview and querystring

Avatar of Isaac
IsaacFlag for United States of America asked on
C#ASP.NET
10 Comments1 Solution610 ViewsLast Modified:
I have a gridview that has 5 columns.  The 5th column is an edit link.
How can I use one or more of the bound fields in the querystring?

The way I did it is not working:
<asp:HyperLinkField NavigateUrl="editAttorney.aspx?mi=<% Eval("Assigned") %>" Text="Edit" />

Thanks!
<asp:GridView ID="GridView2" runat="server" AllowPaging="True" 
        AllowSorting="True" AutoGenerateColumns="False" 
        DataSourceID="orclDataSource" CellPadding="3" CellSpacing="1" Font-Size="Small" 
        ForeColor="#333333" GridLines="None" HorizontalAlign="Center" PageSize="20" 
        Width="85%">
        <RowStyle BackColor="#EFF3FB" />
        <Columns>
            <asp:BoundField DataField="ASSIGNED" HeaderText="Initials" 
                SortExpression="ASSIGNED" />
            <asp:BoundField DataField="ASSIGNED_LAST_NAME" HeaderText="Last Name" 
                SortExpression="ASSIGNED_LAST_NAME" />
            <asp:BoundField DataField="ASSIGNED_FIRST_NAME" HeaderText="First Name" 
                SortExpression="ASSIGNED_FIRST_NAME" />
            <asp:BoundField DataField="ASSIGNED_MI" HeaderText="Middle Initials" 
                SortExpression="ASSIGNED_MI" />
            <asp:HyperLinkField NavigateUrl="editAttorney.aspx" Text="Edit" />
        </Columns>
        <FooterStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
        <PagerStyle BackColor="#2461BF" ForeColor="White" HorizontalAlign="Center" />
        <SelectedRowStyle BackColor="#D1DDF1" Font-Bold="True" ForeColor="#333333" />
        <HeaderStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
        <EditRowStyle BackColor="#2461BF" />
        <AlternatingRowStyle BackColor="White" />
    </asp:GridView>
ASKER CERTIFIED SOLUTION
Rajar Ahmed
Consultant

Our community of experts have been thoroughly vetted for their expertise and industry experience.

Join our community to see this answer!
Unlock 1 Answer and 10 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 10 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros