Hi,

I am in the process of building my first website (no coding experience) My home page (saved as .aspx) uses asp.net controls. All other pages are saved as .html. I can navigate fine from the home page to any of the other pages; however when I try to navigate from the .html page to the home page, the home page just does not load.

It works fine if I change the .html pages to .aspx. Is this the only way to resolve this problem?

Dani AI

Generated

Short answer: the problem is the preview environment, not ASP.NET or your links. Expression Web will often open pages directly from disk (the browser shows a file:// URL) so server-side pages like .aspx are never processed. On a real web server (or when you uploaded) the ASP.NET runtime runs and everything works, which explains the behavior you reported.

Fixes you can apply now:

  • Set up a local web server and preview via HTTP. On Windows that means enabling IIS or installing IIS Express, point a site/virtual directory at your project folder (or copy the site into C:\inetpub\wwwroot) and browse to http://localhost/YourSite/Home.aspx. Expression Web will then preview the page the same way your production server does.
  • For quick checks, open the server URL directly in your browser rather than using the file preview inside EW.
  • If you must preview from disk, use relative links that resolve under file:// (for example href="Default.aspx" or href="../Default.aspx"). Avoid root-leading links like href="/Default.aspx" when testing from the file system.

Troubleshooting tips: look at the browser address bar — file:// vs http:// immediately tells you whether the page is being served. If a direct http://localhost/.../home.aspx opens correctly, the issue was the preview method. As noted, navigation between .html and .aspx works fine when the files are served; , your EW preview was just not running ASP.NET locally.

Recommended Answers

All 2 Replies

Hi,

You should have no problems navigating from an html to aspx and vice versa. You should post your code in your post so that some one can have a look to see where you might have gone wrong.

Cheers

commented: Lightning quick response! Like it. +2

Hi,

You should have no problems navigating from an html to aspx and vice versa. You should post your code in your post so that some one can have a look to see where you might have gone wrong.

Cheers

Hi,

Thanks for the quick reply. I am using Expression Web to develop the site and it seems to be a problem only when I preview the site using EW from a page other than the home page. I’ve uploaded to the web server and can’t seem to replicate this problem from there.

Thanks again.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.