when user click on the link how to open pdf file.... [Resolved]

Posted by Ankitsrist under ASP.NET on 12/28/2012 | Points: 10 | Views : 10612 | Status : [Member] | Replies : 5
i was surfing the tutorial site nd when i click on link the pdf file got opened....so can anyone tell me how to achieve this in asp.net




Responses

Posted by: Saratvaddilli on: 12/28/2012 [Member] [MVP] Bronze | Points: 50

Up
0
Down

Resolved
hi,
just use response.redirect

Response.Redirect("~/YourPdfFile.pdf");


Thanks and Regards
V.SaratChand
Show difficulties that how difficult you are

Ankitsrist, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Pavanandey on: 12/28/2012 [Member] Bronze | Points: 50

Up
0
Down

Resolved
1) <a class="sml_button" href="ch01.pdf"><span>Download PDF</span></a> //in HTML

2) Response.Redirect("~/ch01.pdf"); //Code

Thanks
Pavan Kumar
Mark Answer if this fits the need

Ankitsrist, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Ankitsrist on: 12/28/2012 [Member] Starter | Points: 25

Up
0
Down
thanks frnds....looks silly questn but it helped me....

Ankitsrist, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Ankitsrist on: 12/28/2012 [Member] Starter | Points: 25

Up
0
Down
definitely i will mark answer of both of u....

Ankitsrist, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Jayakumars on: 3/13/2013 [Member] [MVP] Bronze | Points: 25

Up
0
Down
hi
Ankisr try this code fully Client Side working Good.


<div id="div1" runat ="server" style ="visibility:hidden;">
<iframe id="ifrm1" runat ="server" src ="Test.pdf"></iframe>
</div>

<script>
function OpenPdf() {alert('s');
document.getElementById("<%= div1.ClientID %>").style.visibility = 'visible'; return false;
}
</script>

<a href ="#" onclick ="OpenPdf();">Click Open Pdf</a>




Mark as Answer if its helpful to you

Ankitsrist, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response