i had problems with relative paths as well. after going through some articles on web. (one of them is this http://www.ifinity.com.au/Blog/EntryId/46/Why-does-Url-Rewriting-break-all-my-image-links)
i resolved the problem by setting rebaseClientPath
to false
in Context.RewritePath
in Global.asax.
loginstatus control not directing to login page if on a custom url
-
01-04-2022 - |
Question
I have public user profile links like example.com/user/username
.
I have a loginstatus
control in master page.
if i am on a user page, lets say; example.com/user/testuser
and i click on Login, it won't redirect me to Login.aspx
. Instead gives a 404
error.
How can this be solved?
Thanks for help.
Solution
OTHER TIPS
Wherever you write your URLs in your MasterPage
or WebUSerControl
, use the ResolveUrl()
method, as such:
<a href='<%=ResolveUrl("~/MyLoginPage.aspx")%>'>Login</a>
This will ensure that you will get to the right page regardless of the current locationnn.
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow