Decision:
<asp:TemplateField SortExpression="Exp" HeaderText="text"> <ItemTemplate> <asp:HyperLink runat="server" Text='<%# Eval("Name") %>' NavigateUrl='<%# string.Format("~/SubSite/Default.aspx?reg={0}&Source={1}", Eval("Id"), Request.Url) %>' /> </ItemTemplate> </asp:TemplateField>
Instead:
<asp:HyperLinkField DataTextField="Name" DataNavigateUrlFields="Id" DataNavigateUrlFormatString="~\SubSite\Default.aspx?reg={0}" HeaderText="text" SortExpression="Exp" />
Hi
I have a GridView containing some HyperLinkFields. What I'm trying to do is add the "& Source" request to the DataNavigateUrlFormatString
when I click one of the hyperlinks.
When I do it like this: DataNavigateUrlFormatString="~\SubSite\Default.aspx?Query={0}&Source=<% Request.Url.AbsolutePath%>"
The URL I get is the following: http://www.website.com/SubSite/Default.aspx?Query=702&Source=<%Request.Url.AbsolutePath%>
How can I make sure it writes the URL that I am trying to go through <% Request.Url.AbsolutePath%>
?
source share