<div class="col-md-12 col-sm-12 col-xs-12">
<asp:Literal ID="ltEmbed" runat="server"/>
</div>
public void SetTrace_PDF()
{
try
{
// Split AssessmentYear (2017-2018) to--> (2017-18);
var EmpAssesmentYear = drpYear.SelectedValue;
var FirstYear = AssessmentYear.ToString().Substring(0, 5);
var SecondYear = AssessmentYear.ToString().Substring(7, 2);
AssessmentYear = FirstYear + SecondYear;
FY_Year = drpYear.SelectedItem.Text.TrimEnd(' ');
string FilePath = "~\\Traces\\" + FY_Year + "/" + PanNumber + "_" + AssessmentYear + ".pdf";
ltEmbed.Text = string.Format("<object data=\"{0}\" type=\"application/pdf\" width=\"1000px\" height=\"500px\"></object>", ResolveClientUrl(FilePath));
}
catch (Exception ex)
{
}
}
I want to show message if the file is not present in given path i.e in the code
string FilePath = "~\\Traces\\" + FY_Year + "/" + PanNumber + "_" + AssessmentYear + ".pdf";