I have 2 link button. My code which is working:
protected void LinkButton1_Click(object sender, EventArgs e)
{
myframe.Attributes["src"] = "LINQToSQLCheatSheet.pdf";
}
protected void LinkButton2_Click(object sender, EventArgs e)
{
myframe.Attributes["src"] = "20120517110052.pdf";
}
<asp:LinkButton ID="LinkButton1" runat="server" onclick="LinkButton1_Click">Pdf 1</asp:LinkButton>
<asp:LinkButton ID="LinkButton2" runat="server" onclick="LinkButton2_Click">pdf 2</asp:LinkButton>
<div style="width:100%; height:850px">
<iframe id="myframe" width="100%" height="100%" runat="server"></iframe>
But, when I am keeping these 2 pdf files in a folder than this is not working. My code after putting pdf files in a folder:
protected void LinkButton1_Click(object sender, EventArgs e)
{
myframe.Attributes["src"] = "Folder:\\LINQToSQLCheatSheet.pdf";
}
protected void LinkButton2_Click(object sender, EventArgs e)
{
myframe.Attributes["src"] = "Folder:\\20120517110052.pdf";
}
Now, Im getting a error message:
" Firefox doesn't know how to open this address, because the protocol (folder) isn't associated with any program.
You might need to install other software to open this address."
I have tried it in another process as like this:
protected void LinkButton1_Click(object sender, EventArgs e)
{
myframe.Attributes["src"] = "\Folder:\\LINQToSQLCheatSheet.pdf.pdf";
}
protected void LinkButton2_Click(object sender, EventArgs e)
{
myframe.Attributes["src"] = "\Folder:\\20120517110052.pdf.pdf";
}
Now getting another error:
"Unrecognized scape sequence"
Now, can anybody help me by solving this problem as I have to show those pdf file from a Folder or another directory.