Решение предоставлено @ADyson
<script type="text/javascript">
$(document).ready(function () {
$("#FCodeID").on ("change", function () {
var url = "../MaterialsFiles" + this.value;;
window.open(url, '_blank');
})
})
</script>
Кроме того, я изменяю строку .value в моем JsonResult следующим образом:
public JsonResult GetFiles(string MCodeID)
{
List<Files> filelist = new List<Files>();
//Searching Files in //192.168.1.191
string path = @"path to file srv";
string searchPattern = MCodeID + "*";
DirectoryInfo fi = new DirectoryInfo(path);
foreach (var file in fi.GetFiles(searchPattern, SearchOption.AllDirectories))
{
var changeSlash = file.FullName.Replace('\\', '/');
var filepath = changeSlash.Replace("path to file srv", "");
filelist.Add(new Files
{
FCodeID = filepath,
FDescr = file.Name + " - " + Math.Round((Convert.ToDouble(file.Length) / (1024 * 1024)), 2) + " MB",
});
}
filelist.Insert(0, new Files { FCodeID = "0", FDescr = "--Select File--" });
return Json(new SelectList(filelist, "FCodeID", "FDescr"));
}
Наконец, я добавляю новый виртуальный тип:
<site name="MaterialProject" id="2">
<application path="/" applicationPool="Clr4IntegratedAppPool">
<virtualDirectory path="/" physicalPath="path to solution local file" />
<virtualDirectory path="/MaterialsFiles" physicalPath="path to file srv" />
</application>
</site>