I have this partial view that displays links to documents;
@model IList<DocumentLineViewModel>
<tr>
<td class="leftCell" style="width: 150px;">
<label>Documents</label></td>
<td class="rightCell" id="documentCell">
@if (Model.Any(x => x.CurrentUrlFlag))
{
foreach (var document in Model)
{
<a target="_blank" href="@document.CurrentUrl">
@document.CategoryName
</a>
}
}
else
{
<span>Not Entered</span>
}
</td>
</tr>
If the document is a pdf it works fine, I can view the document.
If the document is word (or excel) I get this unwelcome prompt;
How do I stop this?
EDIT One way I tried was to embed the document in a popup but this did not work;
@model IList<DocumentLineViewModel>
<tr>
<td class="leftCell" style="width: 150px;">
<label>Documents</label></td>
<td class="rightCell" id="documentCell">
@if (Model.Any(x => x.CurrentUrlFlag))
{
foreach (var document in Model)
{
if (document.CurrentUrl.ToUpper().EndsWith("PDF"))
{
<a target="_blank" href="@document.CurrentUrl" class="btn">
@document.CategoryName
</a>
}
else
{
<a href="#show-document" class="btn" data-toggle="modal">@document.CategoryName</a>
<div class="modal fade" id="show-document" style="display: none">
<object src="@document.CurrentUrl"><embed src="@document.CurrentUrl"></embed></object>
@* <iframe src="@document.CurrentUrl"></iframe>*@
</div>
}
}
}
else
{
<span>Not Entered</span>
}
</td>
</tr>
The popup appeared, but the content did not show the document.