Link to home
Start Free TrialLog in
Avatar of IUAATech
IUAATech

asked on

need to get URL parameter in a template column of a Gridview

I want to append the URL parameter in the following gridview:

            <ItemTemplate>
                <asp:HyperLink ID="HyperLink1" runat="server" NavigateUrl='<%# "Update.aspx?RequestId="+DataBinder.Eval(Container.DataItem,"RequestId")+"&m=" %>'
                    Text='<%# Bind("RequestId") %>'></asp:HyperLink>
            </ItemTemplate>

basically, I was the value of "m" to be the value of the URL parameter, call it "m" too.

please help.
Avatar of samtran0331
samtran0331
Flag of United States of America image

have you tried adding the request.querystring in there?

<asp:HyperLink ID="HyperLink1" runat="server" NavigateUrl='<%# "Update.aspx?RequestId="+DataBinder.Eval(Container.DataItem,"RequestId")+"&m="+Request.Querystring("m") %>'
                    Text='<%# Bind("RequestId") %>'></asp:HyperLink>
ASKER CERTIFIED SOLUTION
Avatar of dfu23
dfu23

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
NavigateUrl='<%# "Update.aspx?RequestId=" + DataBinder.Eval(Container.DataItem, "RequestId") + "&m=" + DataBinder.Eval(Container.DataItem, "m") %>'
Avatar of IUAATech
IUAATech

ASKER

didn't realize it was that easy :-)

Thanks.