Posted on: 9/23/2013 5:32:51 AM | Views : 568

hi all,
i want to open pdf file in new window. it opens the pdf file in same window correctly when i try to open in new window using,
 <%:Html.ActionLink("Show SLA","SLA",FormMethod.Post,new{slapath=item.slapath,target="_blank"}) %> Or  <%:Html.ActionLink("Show SLA","SLA",null,new{slapath=item.slapath,target="_blank"}) %>
the value of the path returns null to the action controller and throws error.
if i use  <%:Html.ActionLink("Show SLA","SLA",new{slapath=item.slapath,target="_blank"}) %>
and the action method:
public ActionResult SLA(string slapath) { slapath = Server.MapPath("~/DataFiles/SLA/") + slapath; Response.ClearContent(); Response.ClearHeaders(); Response.AddHeader("Content-Disposition", "inline;filename=" + slapath); Response ...

Go to the complete details ...