Please help me to solve this

S

settyv

Hi,

How do i open PDF document with linkbutton using Datagrid control ? I
am using the below code to open the PDF doc.

<asp:TemplateColumn HeaderText="Minute Order">
<ItemTemplate>
<a href="file:///C:\Documents and Settings\Vs3946\My
Documents\Mass_title.pdf" target="_blank">
<asp:LinkButton ID="linkView" runat="server"
CausesValidation="false" CommandName="View" Text="View
"></asp:LinkButton></a>

</ItemTemplate>
</asp:TemplateColumn>


Please let me know how can i do that .Also i need to call the function
on click of Linkbutton.For that i have written code like this

private void grdTest_ItemDataBound(object sender,
System.Web.UI.WebControls.DataGridItemEventArgs e)
{
if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType ==
ListItemType.AlternatingItem)
{
LinkButton btn = e.Item.FindControl("linkView") as
LinkButton;

// SearchParams sp=new SearchParams();
// Minute Min=new Minute();

// e.Item.Attributes["onclick"] =
Min.GetMinuteOrderPdf(sp).ToString ();
e.Item.Attributes["onclick"]
=string.Format("document.getElementById('{0}').click();",
btn.ClientID);





}


Thanks,
Vishnu
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,744
Messages
2,569,483
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top