Question

I'm using Visual Studio 2013. I had a project using the "ASP.NET Web Forms Application" template and published it via file-system. It worked fine and the pages were displayed the same whether I started it from VS or accessed it on the published server.

Unfortunately I was not happy with all the additional files and pages which were created with the template (I only need one .aspx and no login or mobile version). Because there were errors when I started deleting the additional files and pages, I decided to create a new project and copy&paste my written code. This time I created a "New Website" from the "ASP.NET Empty Web Site" template.

I copy&pasted what I already had and worked on it for quite a while (also many css changes). I always tested it via the builtin browser testing from Visual Studio and all looked fine. Now I published the website to the same server from before and out came a page which seems to block every css and javascript and onyl showing plain html.

I think that the reason is because the server requires all pages to be accesses by https (I cannot turn it off even though it would be a solution).

Do I have to somehow configurate my website-project to be runnable on a https server?

Was it helpful?

Solution

Okay I found my mistake:

In my .aspx file I had every css and js files linked with a relative path:

<link rel="stylesheet" href="../styles/core.css?v=1" />

But the deployed folder structure looked like this:

+appfolder
+++/styles
+++/Default.aspx

Solution: <link rel="stylesheet" href="styles/core.css?v=1" />

So the reference was wrong. I still wonder why (started from visual studio) the page was displayed correctly.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top