I have a ASP.NET MVC site and it works just fine when I run it locally.
Once I host that site to IIS 7,images are not showing when i browsed
like this "localhost/WebTest/Start/login",but,if i add slash "/" behind of
these address.it's shown.My image path is "WebTest\Start\Content\test.jpg".
how i fix this problem?i already post this question.i can't get right answer
till now.help me please.
Regards
Chong
May be you have added absolute path to your images.Hence they show up on your local machine and not on the server
Read this and this for an understanding on the same
Related
I have a serious problem that I can not find the cause.
The project works well when running on localhost and without any problems.
But since I published in server it, it does not find some pages in the server .
Like the photos below
Look at this photo of the bar that can not find the path of the entered page.
This is a local host photo that has found the page well
This is my routing system in startup.cs
Server with plesk control panel
Is there a problem with the server?
It's a bit late, but I had the same issue with Index page, and found out that in .csproj file there was something like this and <_ContentIncludedByDefault Remove="Pages\Index.cshtml" /> and after removing those lines everything worked perfectly.
Im sure this question has been asked somewhere else but I cannot seem to get my google foo to work today.
here is my directory structure
My problem is that in my css, image urls do not render correctly between localhost and the production server
example 1
works on local host but not production server
background:url(../Images/mybackground.jpg)
example 2
works on server but not localhost
background:url(../Content/Images/mybackground.jpg)
Can someone explain why Example1 does not work on the server?
The link given by Mauricio Gracia Gutierrez helped solve this. Thank you.
It ends up that The number of directories need to be the same as how you reference it with the bundles along with names being different.
Example
using this structure
bundle.cs
bundles.Add(new StyleBundle("~/one/two").Include("~/Content/Css/site.css");
Layout.cshtml
#Styles.Render("~/one/two")
I have deployed an ASP.NET website on IIS 7. I was able to access my site using the URL http://**local host**/sitename.aspx and all the formatting of my pages is looking good.
But when I access the same page by using the URL http://**servername**/sitename.aspx from another system or on the same server where I have been deployed, the page formatting is not working properly.
What would be the best solution for this? Thanks
First a fall to check your Js/Css file path where you have not mention static file path with localhost name.
For more detail go to browser and browse your url and press F+12 so development tool will be open and check there for broken url.
I am not sure why you are worrying about formatting soo much. I mean formatting should not affect you much unless you use <pre> in your html.
There are ways to modify the HTTP Response Using Filters. Can you please makesure none of these filters present in your application for release mode.
Generally i use HTTP compression feature of IIS to compress my content, but in browser it looks correct to me.
I installed the latest version of Orchard on my dev machine using a base url of localhost/frankgiotto. Then I moved the site to www.frankgiotto.com and updated my Base URL in the settings.
Site works perfectly. I love everything about it but the one thing is that all the links on every page are mapping to www.frankgiotto.com/frankgiotto/etc and I want simply www.frankgiotto.com/etc
This is driving me insane at the moment.. help anyone!?
p.s.. Yes, I made absolutely sure that Base Url is set to www.frankgiotto.com
Interestingly enough, www.frankgiotto.com/Blog and www.frankgiotto.com/frankgiotto/Blog both work and take me to the same place. Its the same with everything else on the site.
This is little out of context, but to make the orchard urls work without any issue on local just do the following
go to Web project
open property->Web
check for "virtual path", set it empty, and all will be fine
that will make the app run without "/", hence less chance for the above issue
Yes, that is a known issue unfortunately. This is because for now links and image addresses are just stored as plain HTML in the database. Ideally, they would be stored as logical references instead and could be rebased on the production server. This feature does not exist today so what we encourage people to do is to use a port rather than a virtual directory on their dev box if they are going to deploy at the root of a domain. This way relative urls just work. In your case I'm afraid you'll have to manually rebase the existing links and change your dev box configuration.
i have uploaded my asp.net 4 web forms site to my testing server. all the database connectivity issue is resolved and its working perfctly but i am having problem the css and the images are not showing neither localy on the server nor if i try to access it from the external link.
i am using master pages. (if this help in anyway )
i have tryed to hard code the styles into a page. they have appeared i think there is something with the path on server i have to create
i have double checked the css path and the images path they are correct but still they are not showing. any idea?
Thank you 4 the help
I had the same problem two minutes ago. Here's the solution.
All you have to do is run ‘optionalfeature’ command and make sure ‘Static Content’ option is checked.