Feb 6, 2007 #1 overDeveloper Programmer Joined Dec 11, 2006 Messages 58 Location US In a datagrid I have a column type HyperLink - I want the Navigate URL to be dynamic as in: page.aspx?id=<%=Request["var"]%> How would I do this?
In a datagrid I have a column type HyperLink - I want the Navigate URL to be dynamic as in: page.aspx?id=<%=Request["var"]%> How would I do this?
Feb 6, 2007 1 #2 milleniumvertex IS-IT--Management Joined Aug 4, 2003 Messages 4 Location US You could use String.Format and bind the results from your datasource. Code: <asp:HyperLink id="hlgglSearch" runat="server" NavigateUrl='<%# String.Format("[URL unfurl="true"]http://www.google.com/search?hl=en&q={0}",DataBinder.Eval(Container.DataItem,"SearchString"))%>'>Search[/URL] Google</asp:HyperLink> Upvote 0 Downvote
You could use String.Format and bind the results from your datasource. Code: <asp:HyperLink id="hlgglSearch" runat="server" NavigateUrl='<%# String.Format("[URL unfurl="true"]http://www.google.com/search?hl=en&q={0}",DataBinder.Eval(Container.DataItem,"SearchString"))%>'>Search[/URL] Google</asp:HyperLink>
Feb 6, 2007 1 #3 ca8msm Programmer Joined May 9, 2002 Messages 11,327 Location GB Or you could simply use a HyperLinkColumn and set it's DataNavigateUrlFormatString. ____________________________________________________________ Need help finding an answer? Try the Search Facility or read FAQ222-2244 on how to get better results. Upvote 0 Downvote
Or you could simply use a HyperLinkColumn and set it's DataNavigateUrlFormatString. ____________________________________________________________ Need help finding an answer? Try the Search Facility or read FAQ222-2244 on how to get better results.