tailieunhanh - Professional ASP.NET 3.5 in C# and Visual Basic Part 120

Professional in C# and Visual Basic Part 120. Building on the revolutionary release, adds several key new developer features including AJAX, LINQ, and a new CSS designer in Visual Web Developer 2008. The dramatic reduction in code that developers realized from the more than 50 new server controls in now allows developers the time to make their applications more interactive with AJAX, to work with data in their preferred language with LINQ, and to build visually attractive and consistent standards-based sites with CSS. . | Chapter 25 File I O and Streams file. If you want to display only the filenames you could use the Directory class s GetFiles method which returns a simple string array of filenames. Figure 25-4 Listing 25-6 shows how to use the TreeView control s SelectedNodeChanged event to bind your Gridview with the file information. Listing 25-6 Binding a GridView to directory files VB script runat server Protected Sub Page_Load ByVal sender As Object ByVal e As If Not Then For Each drive As In Dim node As TreeNode New TreeNode If Then - free space LoadDirectories node Else - not ready End If node Next End If Continued 1150 Chapter 25 File I O and Streams End Sub Private Sub LoadDirectories ByVal parent As TreeNode ByVal path As String Dim directory As _ New path Try For Each d As In Dim node As TreeNode New TreeNode node Recurse the current directory LoadDirectories node Next Catch ex As Access Denied Catch ex As Exception Unknown Error End Try End Sub Protected Sub TreeView1_SelectedNodeChanged _ ByVal sender As Object ByVal e As Dim directory As _ New End Sub script html xmlns http 1999 xhtml head runat server title Binding a Gridview title head body form id form1 runat server div table tr td style width 100px valign top asp TreeView ID TreeView1 runat server OnSelectedNodeChanged TreeView1_SelectedNodeChanged asp TreeView td td valign top asp .

TỪ KHÓA LIÊN QUAN