tailieunhanh - Professional ASP.NET 2.0 XML phần 4

Visual Studio 2005 đi kèm với một tính năng mới Navigator Tag cho phép các nhà phát triển dễ dàng theo dõi vị trí của họ trong một tài liệu HTML, do đó cung cấp hỗ trợ điều hướng tuyệt vời. Các Navigator Tag hiển thị đường dẫn hiện tại bên trong mã nguồn của một trang HTML bằng cách hiển thị một danh sách của tất cả | Chapter 6 tr td style width 101px height 41px First Name td td style width 204px height 41px asp TextBox ID txtFirstName runat server Width 201px asp TextBox td tr tr td style width 101px height 41px Last Name td td style width 204px height 41px asp TextBox ID txtLastName runat server Width 201px asp TextBox td tr tr td style width 101px height 41px Price td td style width 204px height 41px asp TextBox ID txtPrice runat server Width 201px asp TextBox td tr tr td colspan 2 style width 101px height 41px asp Button Text Save runat server ID btnSave Width 95px OnClick btnSave_Click td tr tr td colspan 2 style width 101px height 41px asp Label runat server ID lblResult Width 295px td tr table div form body html Basically Listing 6-5 provides a Web form where you can enter the details of a book. It captures the entered book details and saves them onto an XML file named . At the time of writing the file it checks to see if the file is already available if so it appends the book details to the existing XML document otherwise it creates an XML document from scratch and adds the book details to that newly created document. Finally it saves the XML file using the Save method. 154 XML DOM Object Model It all starts with a check to see if the XML file is already available in the file system. if xmlPath If the file is available the file is loaded onto an XML document. xmlPath As the name suggests the CreateBookNode method is a helper method that basically creates a book node that contains all the child nodes and the related attributes based on the details keyed in by the user. XmlNode bookNode CreateBookNode doc After the book node is created the next step is to append the book node to the root bookstore node. Before doing that you need to get reference to the bookstore node. XmlNode bookStoreNode bookstore bookNode If the file is not present in the directory you .

TỪ KHÓA LIÊN QUAN
crossorigin="anonymous">
Đã phát hiện trình chặn quảng cáo AdBlock
Trang web này phụ thuộc vào doanh thu từ số lần hiển thị quảng cáo để tồn tại. Vui lòng tắt trình chặn quảng cáo của bạn hoặc tạm dừng tính năng chặn quảng cáo cho trang web này.