reza reza - 3 years ago 185
ASP.NET (C#) Question

how to add some conditional code for redirect to page in

I have a

in bound to master page. The Confirm-user page is in folder(Manage_pages). I have the sidebar in master page and use this code for list all page that user can access:

<div id="sidebar">
<% foreach (DAL.Page page in pageList)
<% Response.Write("<li><a href="+page.PageAddress+">"+page.PageName+"</a></li>"); %>
<% }%>

The problem is that when I click on Confirm-user page link I go to this page successfully:


But when I click on link again it does not work and go to:


Please help me!

Answer Source


<a href='<%=ResolveClientUrl("~/ConfirmUser.aspx")%>'>text</a>

the "~/ConfirmUser.aspx" could be "~/Manage_pages/ConfirmUser.aspx" if Manage_pages is your intended sub folder but not your application name

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download