Please help me to solve this

Discussion in 'ASP .Net' started by settyv@gmail.com, Nov 15, 2006.

  1. Guest

    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
    , Nov 15, 2006
    #1
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. KK
    Replies:
    2
    Views:
    525
    Big Brian
    Oct 14, 2003
  2. Andrej Hocevar
    Replies:
    1
    Views:
    473
    Nick Austin
    Aug 18, 2003
  3. tyler_durden
    Replies:
    7
    Views:
    336
    Nick Keighley
    Jan 3, 2005
  4. Simon
    Replies:
    2
    Views:
    389
    red floyd
    Jan 29, 2007
  5. kris
    Replies:
    9
    Views:
    761
    Manish Pandit
    Sep 13, 2007
Loading...

Share This Page