Click here to Skip to main content
15,894,410 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have following code in MasterPage.aspx page to logout the user:
ASP.NET
<asp:HyperLink ID="HyperLink1" runat="server" Font-Bold="True" ForeColor="#333333"
                                            Font-Underline="False" NavigateUrl='<%#"~/DeleteCookie.aspx?currenturl="+thisurl()%>' >|Logout</asp:HyperLink>

I want to pass current url to DeleteCookie.aspx page as QueryString so that the current page can be redirected(Refresh).
I am using following code in file of MasterPage.aspx.cs:
C#
protected string thisurl()
    {
        return HttpUtility.UrlEncode(Request.Url.AbsoluteUri);
    }

But its not working because I am unable to click on hyperlink.
Please help in finding the solution.
Posted

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900