Last post Aug 06, 2013 01:09 PM by zhshqzyc
Aug 01, 2013 02:48 PM|zhshqzyc|LINK
It is a asp.net mvc 4 site. When I approached a jpg image
Server Error in '/' Application.
There is no build provider registered for the extension '.jpg'.
You can register one in the
<compilation><buildProviders> section in machine.config or web.config.
The error is only on hosted provider server. I checked it in localhost, it worked well.
Aug 01, 2013 02:56 PM|krokonoster|LINK
Why would you use a url like that?
You know in MVC url's point to controller actions?
What would work if you say had a "Download" controller, and "Image" action method, taking in the id of an image or whatever.
Then the controller action reutrn a file result (or something in that effect)
So you will have www.demo.net/download/image/1
Aug 01, 2013 03:05 PM|zhshqzyc|LINK
My live site is www.wscccdemo.net, the images could not be loaded in the home page. Because when I use firebug, it showed the error like this.
"NetworkError: 500 Internal Server Error - http://www.wscccdemo.net/images/2.jpg"
The code is quite simple,
<div id="slider" class="nivoSlider">
<img src="images/1.jpg" alt="" />
<img src="images/2.jpg" alt="" />
<img src="images/3.jpg" alt="" />
<img src="images/4.jpg" alt="" />
<img src="images/5.jpg" alt="" />
I don't know why this wield error.
Aug 01, 2013 03:09 PM|krokonoster|LINK
try (assuming "images" is a folder in your root...or modify accordingly)
<img src="~/images/1.jpg" alt="" />
Aug 01, 2013 03:36 PM|imran_ku07|LINK
Show us your global.asax
Aug 01, 2013 07:20 PM|zhshqzyc|LINK
The global.asax is:
<%@ Application Codebehind="Global.asax.cs" Inherits="wsccc1.MvcApplication" Language="C#" %>
Aug 01, 2013 07:33 PM|imran_ku07|LINK
I mean global.asax.cs
Aug 01, 2013 11:12 PM|zhshqzyc|LINK
// Note: For instructions on enabling IIS6 or IIS7 classic mode,
// visit http://go.microsoft.com/?LinkId=9394801
public class MvcApplication : System.Web.HttpApplication
protected void Application_Start()
Aug 02, 2013 12:37 PM|imran_ku07|LINK
Can you share a sample application?
Aug 02, 2013 01:42 PM|zhshqzyc|LINK
I will delete it at noon. It is a sample in localhost. The live version only changes the localhost to real domain name and uses the live server.
My hosted provider is arvixe.com, their support has no idea about it.
Aug 02, 2013 02:02 PM|MLeda|LINK
I have to agree with Krokonoster, its should be a rout/controller problem.
Once you get the right action for the controller the default rout should provide your download.
Aug 02, 2013 02:11 PM|zhshqzyc|LINK
Just ignore approaching the images directly. Why the my images on the web page could not be loaded?
Aug 02, 2013 09:25 PM|imran_ku07|LINK
I am asking for sample project that is causing this issue not sample html file
Aug 03, 2013 12:05 AM|zhshqzyc|LINK
Sorry for confusion, I deleted that zip file at noon and now I upload it again. The zip file name is "wsccc1.zip" that contains everything. To avoid confusion, I deleted unrelated html files.
The link is at https://skydrive.live.com/?cid=03a8bb9eaeeff1db#cid=03A8BB9EAEEFF1DB&id=3A8BB9EAEEFF1DB!234
Aug 03, 2013 02:40 PM|imran_ku07|LINK
Your application running fine without any error. There is something wrong in your iis settings. You can try,
<add extension=".jpg" type="System.Web.Compilation.ForceCopyBuildProvider"/>
Aug 03, 2013 04:47 PM|zhshqzyc|LINK
It is still not working. I am afraid of the hosted provider denying their fault if it is IIS settings.
Aug 04, 2013 07:14 AM|imran_ku07|LINK
Now what error u are getting.
Aug 04, 2013 01:44 PM|zhshqzyc|LINK
Aug 06, 2013 01:09 PM|zhshqzyc|LINK
Now it is working, it is the IIS setting issue. The hosted provider reset it by my a few times of request.
Thanks for help anyway.