0
this solve me
src = "../../Images/img/" + fileName
0
Hi,<br>
Instead of ../ try using ~/
0
The below method for getting images
public List<slider> GetData()
{
string[] filePaths = Directory.GetFiles(System.Web.HttpContext.Current.Server.MapPath("/Images/img/"));
List<slider> files = new List<slider>();
var model = new System.Collections.Generic.List<slider>();
foreach (string filePath in filePaths)
{
string fileName = Path.GetFileName(filePath);
model.Add(new slider
{
title = fileName.Split('.')[0].ToString(),
src = "../Images/img/" + fileName
});
}
return model;
}
0
None of the links works for me
basically I have a simple webapplication in _Layout.cshtml I have a slider it works fine on home {index} and service {index} view but when i click any of the service to get its details i am getting 404 error because instead of finding the images,js and css from the root/js,root/images,root/css
it is finding the images from
root/Service/Images/JS/one.js and same for css and images
it changes the url why it is so below is my linkbutton code
@Html.ActionLink("ReadMore", "Details", "Service", new { id = item.ID },null)
0
Hi,<br><br>
Please have a look at below threads-<br>
http://stackoverflow.com/questions/9779340/mvc-partial-views-loses-track-of-the-images-folder-when-using-jquery<br>
http://scottonwriting.net/sowblog/archive/2010/05/11/resolve-a-url-from-a-partial-view-asp-net-mvc.aspx
0
http://stackoverflow.com/questions/912755/include-javascript-file-in-partial-views
0
http://stackoverflow.com/questions/5110028/add-css-or-javascript-files-to-layout-head-from-views-or-partial-views