Default security setting for modern browsers disallows usage of file://
protocol in elements with src
attribute, including iframe
(related issues here and here, see also same origin policy). Use server's relative path instead as in example below.
Controller
var model = new ViewModel();
model.urlpath = string.Format("~/images/{0}/{1}", "1324", "Sample_Document.pdf");
View
<iframe src="@Url.Content(Model.urlpath)" width="650" height="350" style="border: 1px solid #ccc; margin:10px 5px !important;"></iframe>
Or use hardcoded virtual path inside @Url.Content
and just pass file name from viewmodel property:
Controller
var model = new ViewModel();
model.FileName = "Sample_Document.pdf";
View
<iframe src="@Url.Content("~/images/1324" + Model.FileName)" width="650" height="350" style="border: 1px solid #ccc; margin:10px 5px !important;"></iframe>