0

I am creating a website and I'm trying to implement routing feature. Most of the time it works fine, but I've found a problem while routing between different web forms placed at different levels from the root of the website.

enter image description here

The above picture shows all the routes defined and picture below shows the solution explorer of my project:

enter image description here

Home page(home.aspx) of my website is shown below:

enter image description here

On clicking the picture it opens a new page(singlepage.aspx) with whole article about the topic and contains the required url(sitename/heading/querystring):

enter image description here

But from there when i click on HOME button, it does not take me to home page, but instead gets me to the url like this:

enter image description here

Seems like it is not calling the "routeHome" route, instead calls "routeSinglePage".

This is how the html for taking us to HOME page is:

enter image description here

So I wanted to know how I can get it to the home page from singlepage.aspx by clicking on HOME button. Do I need to add new routes or something else.

Thanks

1 Answer 1

1

Change the HTML to:

<li><a href="/Home">Home</a></li>
<li><a href="/AbousUs">About</a></li>
<li><a href="/ContactUs">Contact</a></li>

The "/" indicates an absolute path, you are currently using a relative path and hence the issue.

Sign up to request clarification or add additional context in comments.

1 Comment

No problem after that

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.