Question

I need help about creating anchor tag inside the content tag. It works if I set the exact path like <a id="loginLink" runat="server" href="~/Account/Login">Log in</a> . But is there a solution if I want to set dynamicaly created path through Session like this:

<asp:Content ID="Content3" ContentPlaceHolderID="MainContent" runat="server">
    <ul>
        <li><a id="registerLink" href='<%# Session["PreviousPage"] %>'>Register</a></li>
    </ul>
</asp:Content>
Was it helpful?

Solution

It should be work fine:

<a id="registerLink" href="<%= Session["PreviousPage"] %>">Register</a>
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top