1 / 11

XML with ASP using ASP:DataList

XML with ASP using ASP:DataList. Please use speaker notes for additional information!. <EMPLOYEE> <FIRST_NAME>Carl</FIRST_NAME> <LAST_NAME>Hersey</LAST_NAME> <DEPT>Foreign</DEPT> <JOB>Consultant</JOB> <SALARY>60000</SALARY> </EMPLOYEE>

macy
Download Presentation

XML with ASP using ASP:DataList

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. XML with ASPusing ASP:DataList Please use speaker notes for additional information!

  2. <EMPLOYEE> <FIRST_NAME>Carl</FIRST_NAME> <LAST_NAME>Hersey</LAST_NAME> <DEPT>Foreign</DEPT> <JOB>Consultant</JOB> <SALARY>60000</SALARY> </EMPLOYEE> </PERSONNEL> <?xml version="1.0" ?> <!-- Data for Payroll --> <PERSONNEL> <EMPLOYEE> <FIRST_NAME>Stephen</FIRST_NAME> <LAST_NAME>Daniels</LAST_NAME> <DEPT>Sports</DEPT> <JOB>Reporter</JOB> <SALARY>50000</SALARY> </EMPLOYEE> <EMPLOYEE> <FIRST_NAME>Al</FIRST_NAME> <LAST_NAME>Richards</LAST_NAME> <DEPT>Engineering</DEPT> <JOB>Consultant</JOB> <SALARY>95000</SALARY> </EMPLOYEE> <EMPLOYEE> <FIRST_NAME>Jennifer</FIRST_NAME> <LAST_NAME>Ames</LAST_NAME> <DEPT>Foreign</DEPT> <JOB>Consultant</JOB> <SALARY>55000</SALARY> </EMPLOYEE> <EMPLOYEE> <FIRST_NAME>Sarah</FIRST_NAME> <LAST_NAME>Grant</LAST_NAME> <DEPT>Scientific</DEPT> <JOB>Web</JOB> <SALARY>50000</SALARY> </EMPLOYEE>

  3. <%@ Import Namespace="System.Data" %> <script runat="server"> sub Page_Load if Not Page.IsPostBack then dim payrollData=New DataSet payrollData.ReadXml(MapPath("payroll.xml")) payrollSet.DataSource=payrollData payrollSet.DataBind() end if end sub </script> <html> <body> <form runat="server"> <h2>Employee List</h2> <asp:DataList id="payrollSet" gridlines="both" runat="server"> <HeaderTemplate> <b>Last Name / First Name / Dept / Job / Salary</b> </HeaderTemplate> <ItemTemplate> <%#Container.DataItem("LAST_NAME")%> / <%#Container.DataItem("FIRST_NAME")%> / <%#Container.DataItem("DEPT")%> / <%#Container.DataItem("JOB")%> / <%#Container.DataItem("SALARY")%> </ItemTemplate> </asp:DataList> </form> </body> </html>

  4. <%@ Import Namespace="System.Data" %> <script runat="server"> sub Page_Load if Not Page.IsPostBack then dim payrollData=New DataSet payrollData.ReadXml(MapPath("payroll.xml")) payrollSet.DataSource=payrollData payrollSet.DataBind() end if end sub </script> <html> <body> <form runat="server"> <h2>Employee List</h2> <asp:DataList id="payrollSet" gridlines="both" runat="server"> <HeaderTemplate> <b>Employees</b> </HeaderTemplate> <ItemTemplate> <%#Container.DataItem("LAST_NAME")%>, <%#Container.DataItem("FIRST_NAME")%> has a Job of: <%#Container.DataItem("JOB")%> in Dept: <%#Container.DataItem("DEPT")%> with a Salary of: <%#Container.DataItem("SALARY")%> </ItemTemplate> </asp:DataList> </form> </body> </html>

  5. <%@ Import Namespace="System.Data" %> <script runat="server"> sub Page_Load if Not Page.IsPostBack then dim payrollData=New DataSet payrollData.ReadXml(MapPath("payroll.xml")) payrollSet.DataSource=payrollData payrollSet.DataBind() end if end sub </script> <html> <body> <form runat="server"> <h2>Employee List</h2> <asp:DataList id="payrollSet" gridlines="both" runat="server"> <HeaderTemplate> <tr> <th>Last Name</th> <th>First Name</th> <th>Dept</th> <th>Job</th> <th>Salary</th> </tr> </HeaderTemplate> <ItemTemplate> <tr> <td><%#Container.DataItem("LAST_NAME")%></td> <td><%#Container.DataItem("FIRST_NAME")%></td> <td><%#Container.DataItem("DEPT")%></td> <td><%#Container.DataItem("JOB")%></td> <td><%#Container.DataItem("SALARY")%></td> </tr> </ItemTemplate> </asp:DataList> </form> </body> </html>

  6. <%@ Import Namespace="System.Data" %> <script runat="server"> sub Page_Load if Not Page.IsPostBack then dim optionData=New DataSet optionData.ReadXml(MapPath("bccopt.xml")) optionSet.DataSource=optionData optionSet.DataBind() end if end sub </script> <html> <body> <form runat="server"> <h2>Option List</h2> <asp:DataList id="optionSet" gridlines="both" runat="server"> <HeaderTemplate> <tr> <th>Name</th> <th>Advisor</th> </tr> </HeaderTemplate> <ItemTemplate> <tr> <td><%#Container.DataItem("optionname")%></td> <td><%#Container.DataItem("optionadv")%></td> </tr> </ItemTemplate> </asp:DataList> </form> </body> </html>

  7. <?xml version="1.0" ?> <!-- Data for BCC Departments --> <bcc> <option> <optionname>Programming</optionname> <optionadv>Grocer</optionadv> </option> <option> <optionname>Webmaster</optionname> <optionadv>Grocer</optionadv> </option> <option> <optionname>Networking</optionname> <optionadv>Arruda</optionadv> </option> <option> <optionname>Business Information</optionname> <optionadv>Grocer</optionadv> </option> <option> <optionname>Multimedia/Internet</optionname> <optionadv>Vieira</optionadv> </option> <option> <optionname>Computer Science</optionname> <optionadv>Ferreira</optionadv> </option> <option> <optionname>Information Systems</optionname> <optionadv>Grocer</optionadv> </option> <option> <optionname>Accounting</optionname> <optionadv>Garand</optionadv> </option>

  8. <option> <optionname>Marketing Management</optionname> <optionadv>Leonard</optionadv> </option> <option> <optionname>Retail Management</optionname> <optionadv>Dickens</optionadv> </option> <option> <optionname>Business Administration</optionname> <optionadv>Leonard</optionadv> </option> </bcc>

  9. <?xml version="1.0" ?> <!-- Data for BCC Departments --> <bcc> <department> <deptname>Computer Information Systems</deptname> <optiontype> <typename>Career</typename> <option> <optionname>Programming</optionname> <optionadv>Grocer</optionadv> </option> <option> <optionname>Webmaster</optionname> <optionadv>Grocer</optionadv> </option> <option> <optionname>Networking</optionname> <optionadv>Arruda</optionadv> </option> <option> <optionname>Business Information</optionname> <optionadv>Grocer</optionadv> </option> <option> <optionname>Multimedia/Internet</optionname> <optionadv>Vieira</optionadv> </option> </optiontype> <optiontype> <typename>Transfer</typename>

  10. <option> <optionname>Computer Science</optionname> <optionadv>Ferreira</optionadv> </option> <option> <optionname>Information Systems</optionname> <optionadv>Grocer</optionadv> </option> </optiontype> </department> <department> <deptname>Business</deptname> <optiontype> <typename>Career</typename> <option> <optionname>Accounting</optionname> <optionadv>Garand</optionadv> </option> <option> <optionname>Marketing Management</optionname> <optionadv>Leonard</optionadv> </option> <option> <optionname>Retail Management</optionname> <optionadv>Dickens</optionadv> </option> </optiontype> <optiontype> <typename>Transfer</typename> <option> <optionname>Business Administration</optionname> <optionadv>Leonard</optionadv> </option> </optiontype> </department> </bcc>

  11. <%@ Import Namespace="System.Data" %> <script runat="server"> sub Page_Load if Not Page.IsPostBack then dim optionData=New DataSet optionData.ReadXml(MapPath("bccoptions.xml")) optionSet.DataSource=optionData.Tables("option") optionSet.DataBind() end if end sub </script> <html> <body> <form runat="server"> <h2>Option List</h2> <asp:DataList id="optionSet" gridlines="both" runat="server"> <HeaderTemplate> <tr> <th>Name</th> <th>Advisor</th> </tr> </HeaderTemplate> <ItemTemplate> <tr> <td><%#Container.DataItem("optionname")%></td> <td><%#Container.DataItem("optionadv")%></td> </tr> </ItemTemplate> </asp:DataList> </form></body></html>

More Related