문제

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>
도움이 되었습니까?

해결책

It should be work fine:

<a id="registerLink" href="<%= Session["PreviousPage"] %>">Register</a>
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top