Paul Rajs

Paul Rajs

  • 1.4k
  • 641
  • 113.1k

how to open a Pdf by Clicking gridview Itemtemplate Linkbut

Mar 29 2018 3:14 AM
hi developers ,
 
i want to open a popup instead of another popup.
 
when i click the first popup the gridview is opened. inside gridview ther is some Itemtemplate Links for each Chapter. like Chapter1,Chapter2,Chapter3,Chapter4 etc.
 
when i clicking the Particular Chapter link means the particular chapter pdf file should be open without Refresh the page.
 
the following code am adding , it is exactly working for Text Only.but i dont know how to open a Pdf instead of this text . thats all.
 
so please help me how can i open the pdf instead of text on the same way .
 
so please anyone know how to dispaly a pdf when click gridview itemtemplate suggest me to i am done this task
 
Html Grid View Code
  1. <asp:GridView ID="GridView1" HeaderStyle-BackColor="#3AC0F2" HeaderStyle-ForeColor="White" runat="server" AutoGenerateColumns="false">  
  2. <Columns>  
  3. <asp:BoundField DataField="Id" ItemStyle-CssClass="Id" HeaderText="Id" ItemStyle-Width="30" />  
  4. <asp:BoundField DataField="Name" ItemStyle-CssClass="Name" HeaderText="Name" ItemStyle-Width="150" />  
  5. <asp:BoundField DataField="Description" ItemStyle-CssClass="Description" HeaderText="Description" ItemStyle-Width="150" />  
  6. <asp:TemplateField> <ItemTemplate> <asp:LinkButton Text="View" ID="lnkView" runat="server" />  
  7. </ItemTemplate>  
  8. </asp:TemplateField>  
  9. </Columns>  
  10. </asp:GridView>  
  11. <div id="dialog" style="display: none"> <b>Id:</b> <span id="id"></span> <br /> <b>Name:</b> <span id="name"></span> <br /> <b>Description:</b> <span id="description"></span> </div>  
Jquery Code--
  1. <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script>  
  2. <script src="http://ajax.aspnetcdn.com/ajax/jquery.ui/1.8.9/jquery-ui.js" type="text/javascript"></script>  
  3. <link href="http://ajax.aspnetcdn.com/ajax/jquery.ui/1.8.9/themes/start/jquery-ui.css" rel="stylesheet" type="text/css" />  
  4. <script type="text/javascript">  
  5. $(document).on("click""[id*=lnkView]"function ()  
  6. {  
  7. $("#id").html($(".Id", $(this).closest("tr")).html());  
  8. $("#name").html($(".Name", $(this).closest("tr")).html());  
  9. $("#description").html($(".Description", $(this).closest("tr")).html());  
  10. $("#dialog").dialog({ title: "View Details", buttons: { Ok: function () { $(this).dialog('close'); } }, modal: true });  
  11. return false; });  
  12. </script>  
thanking you
Paul.S

Answers (1)