Reference a different attribute

2 posts, 0 answers
  1. Jeff
    Jeff avatar
    6 posts
    Member since:
    May 2016

    Posted 28 Sep Link to this post

    I have a XML file for users to click a link to display a help pdf.  The XML is using Node Text = Course and I can use Text to display the PDF in an iframe.  The XML has attributes of PDFFile and Permissions, also.

    A part of the xml file:

    <Node Text="System Software Requirements" PDFName="SystemSoftware" Permissions="Administrator,Installer">
        <Node Text="Client PC System Software" PDFName="SystemSoftwareClientPC" Permissions="Administrator,Installer"/>
        <Node Text="Server System Software" PDFName="SystemSoftwareServer" Permissions="Administrator,Installer"/>
    </Node>

    In the C# code behind, I am using Telerik.Web.UI.RadTreeNodeEventArgs e

    string PDFName = e.Node.Text

    to display the pdf file

    I would like to use PDFName to display the PDF file and remove the link if the person is not an Administrator or Installer.  I have tried selectedName.Attribute("PDFName"), but it is giving me an error.  What attribute should I use?

    Thanks,

    Jeff

  2. Nencho
    Admin
    Nencho avatar
    1457 posts

    Posted 03 Oct Link to this post

    Hello Jeff,

    Instead of selectedName.Attribute("PDFName"), could you try using selectedName.Attribute["PDFName"]. The attributes are key-value based, which is why, you need to use [ ] brackets.

    Regards,
    Nencho
    Telerik by Progress
    Do you need help with upgrading your ASP.NET AJAX, WPF or WinForms projects? Check the Telerik API Analyzer and share your thoughts.
  3. UI for ASP.NET Ajax is Ready for VS 2017
Back to Top