locked
Add link to the header of a panel being used with collapsiblePanelExtender RRS feed

  • Question

  • User1820622718 posted

    Hello,

    I'm creating my panels dynamically based on the number of rows of data from my stored procedure.

    What I want to do is add a link to a pdf file on the header row, but everytime I press on the header row it opens the body panel for that header.

    Is it possible to add links to a panel?   

    Friday, February 26, 2016 9:44 PM

All replies

  • User61956409 posted

    Hi Jerry,

    What I want to do is add a link to a pdf file on the header row, but everytime I press on the header row it opens the body panel for that header.

    Is it possible to add links to a panel?   

    If you’d like to open the PDF in panel content, you could try to specify a custom attribute for link button to store the file name, then you could find and display PDF file in content based on file name.

    <asp:LinkButton ID="LinkButton1" runat="server" data-fname="pdf1" OnClick="LinkButton1_Click">LinkButton</asp:LinkButton>
    protected void LinkButton1_Click(object sender, EventArgs e)
    {
        string fname = LinkButton1.Attributes["data-fname"];
    }
    

    Best Regards,

    Fei Han



    Monday, February 29, 2016 3:25 AM
  • User1820622718 posted

    Hi Fei,


    Thank you for the reply.

    I'm doing this in the C# code using a for loop based on the number of Items I need to create panels for. 

    This is how the structure currently looks

    <Update Panel>
      <panel>[THIS IS THE TITLE]    [PDF Link]</panel>
      <panel>Body</panel>
    </Update Panel>

    The issue is when I click anywhere on the first panel it opens the body panel.  I can't click on the [pdf link].  There might be 50 records so that is 2 panels per record.

    Thank you

    Monday, February 29, 2016 1:37 PM
  • User61956409 posted

    Hi Jerry,

    The issue is when I click anywhere on the first panel it opens the body panel.  I can't click on the [pdf link]. 

    Would you like to click the PDF link to open the PDF file in a new window? Besides, could you share us a simple sample to reproduce your problem?

    Best Regards,

    Fei Han

    Tuesday, March 1, 2016 7:39 AM