我使用this extension在我的MVC应用程序中嵌入了一个.ascx文件。在ascx中有一个asp:Chart对象。
当我打开我的页面http://localhost:56854/Machines/Details/1时,没有图表图像。查看页面源代码,我发现ChartImg.axd的路径有问题。图像得到了
src="/Machines/Details/ChartImg.axd?i=chart_8b0e12daec9447feb9986442e53243d2_0.png&g=becaa2f59bec483eab9e9103620711eb"仅访问
localhost:56854/ChartImg.axd?i=chart_8b0e12daec9447feb9986442e53243d2_0.png&g=becaa2f59bec483eab9e9103620711eb在网页浏览器中给了我正确的图像。我的问题是:如何改变这条道路?
发布于 2014-07-24 21:06:58
我已经找到解决方案了。只需将以下行添加到RouteConfig.cs文件:
routes.IgnoreRoute("{resource}.axd/{*pathInfo}");
routes.IgnoreRoute("{controller}/{resource}.axd/{*pathInfo}");
routes.IgnoreRoute("{controller}/{action}/{resource}.axd/{*pathInfo}");发布于 2015-03-29 02:31:35
这个问题有更多关于这个问题的信息和解释。
https://stackoverflow.com/questions/24903826
复制相似问题