temp
temp

Reputation: 19

Capture the current browser url in asp.net

When I want to take current url in asp.net page. I want to bind this in repeater.

<asp:Repeater ID="rptList" runat="server">   
    <ItemTemplate>
                <asp:HyperLink ID="hlOtherUrl" runat="server" Text="link" NavigateUrl='<%# Eval("ID") %>'></asp:HyperLink></p>           
    </ItemTemplate> 
</asp:Repeater>

For example - http://www.test.com?ID=3 How to do this?

Upvotes: 1

Views: 2166

Answers (2)

Alex
Alex

Reputation: 6149

You can get the current page url by doing this:

Response.Write(Request.Url.AbsoluteUri);

in your case i guess you need it here:

NavigateUrl='<%# Request.Url.AbsoluteUri %>

Upvotes: 2

machine
machine

Reputation: 1390

This page has a very concise guide: http://powerasp.net/content/new/get-current-page-url.asp

Upvotes: 0

Related Questions