« Home « Chủ đề chủ đề và giao diện

Chủ đề : chủ đề và giao diện


Có 60+ tài liệu thuộc chủ đề "chủ đề và giao diện"

Professional ASP.NET 3.5 in C# and Visual Basic Part 40

tailieu.vn

You can either check the Enable Paging check box in the DetailsView smart tag or add the attribute to the control in HTML View. Listing 7-49 shows the DetailsView code for the control.. <asp:DetailsView ID="DetailsView1". DataKeyNames="CustomerID"></asp:DetailsView>. Like the GridView, the DetailsView control enables you to customize the control’s Pager using the Pager- Settings - Mode , as well as the...

Professional ASP.NET 3.5 in C# and Visual Basic Part 41

tailieu.vn

LayoutTemplate The template that serves as the root container for the ListView control and is used to control the overall layout of the data items GroupSeparatorTemplate Used to provide a separator UI between groups. The use of templates allows the ListView control to retain a very basic level of information about the markup sections and states which can comprise the...

Professional ASP.NET 3.5 in C# and Visual Basic Part 42

tailieu.vn

<asp:Label ID="CountryLabel". Text=’<. Bind("Country") %>’>. </asp:Label></td>. <asp:Label ID="PhoneLabel". Bind("Phone") %>’>. </asp:Label><br />. <asp:Label ID="FaxLabel". Bind("Fax") %>’>. <asp:Button ID="Button1". </asp:FormView>. <asp:SqlDataSource ID="SqlDataSource1". ConnectionStrings:AppConnectionString1 %>">. </asp:SqlDataSource>. ASP.NET 1.0/1.1 contained many other controls that could be bound to data sources. ASP.NET 2.0 retained those controls, enhanced some, and added several additional bound controls to the toolbox ASP.NET 3.5 continues to include these controls...

Professional ASP.NET 3.5 in C# and Visual Basic Part 43

tailieu.vn

Chapter 7: Data Binding in ASP.NET 3.5. In this chapter, you examined data binding in ASP.NET. Using the data source controls’. You examined how even a beginning developer can easily combine the data source controls with the GridView, ListView, and DetailsView controls to create powerful data manipulation applications with a minimal amount of coding.. You saw how ASP.NET includes a...

Professional ASP.NET 3.5 in C# and Visual Basic Part 44

tailieu.vn

When you complete your connection to the data source, be sure that you close the connection by using conn.Close. Using the Command Object. The Command object uses the Connection object to execute SQL queries. The Command object provides a number of Execute methods that can be used to perform various types of SQL queries.. Next, take a look at some...

Professional ASP.NET 3.5 in C# and Visual Basic Part 45

tailieu.vn

It didn’t even allow you to serialize the DataTable object independently of the larger and encompassing DataSet object. This limitation required you to always use the DataSet object to perform any operation on a DataTable . The current version of ADO.NET removes this limitation and enables you to work directly with the DataTable for all your needs. In fact, we...

Professional ASP.NET 3.5 in C# and Visual Basic Part 46

tailieu.vn

<span id="DataList1_ctl00_CompanyNameLabel">Alfreds Futterkiste</span>. <span id="DataList1_ctl01_CompanyNameLabel">. <asp:DataList ID="DataList1". runat="server". RepeatLayout="Flow">. <asp:Label ID="CompanyNameLabel". runat="server". Text=’<. Eval("CompanyName") %>’ />. </asp:DataList>. <span id="DataList1">. <head runat="server">. runat="server">. DataSourceID="SqlDataSource1">. <asp:SqlDataSource ID="SqlDataSource1". SelectCommand="SELECT [CompanyName] FROM [Customers]">. </asp:SqlDataSource>. GridLines="Vertical">. RepeatDirection="Horizontal">. <asp:ListView ID="ListView1". </asp:ListView>. @CustomerID">. <asp:Parameter Name="CompanyName". <asp:Parameter Name="ContactName". <asp:Parameter Name="ContactTitle". <asp:Parameter Name="Address". <asp:Parameter Name="City". <asp:Parameter Name="Region". <asp:Parameter Name="PostalCode". <asp:Parameter Name="Country". <asp:Parameter Name="Phone". <asp:Parameter Name="Fax". <asp:Parameter Name="CustomerID". <table runat="server">....

Professional ASP.NET 3.5 in C# and Visual Basic Part 47

tailieu.vn

<td>No data was returned.</td>. This section allows you to define how a form should be laid out for inserting data, similar to that used in the ItemTemplate , into the data store.. Listing 8-28 shows an example of the InsertItemTemplate . Text=’<. Bind("CustomerID") %>’ />. Bind("CompanyName") %>’ />. Bind("ContactName") %>’ />. After you have created an additional AlternatingItemTemplate that is...

Professional ASP.NET 3.5 in C# and Visual Basic Part 48

tailieu.vn

After you close the Add Table dialog box, you see a visual representation of the table that you selected in the Query Builder dialog box (see Figure 8-19). You can then select some or all the fields to be returned from the query. add text to the query so that it looks like the following:. With this query, you specify...

Professional ASP.NET 3.5 in C# and Visual Basic Part 49

tailieu.vn

It should be set to False for asynchronous processing.. Now that you understand asynchronous methods added to the SqlCommand and how to properly interact with them, you can write some code to see the asynchronous processing in action.. Approaches of Asynchronous Processing in ADO.NET. The second approach is to provide a callback method while starting the asynchronous process. When the...

Professional ASP.NET 3.5 in C# and Visual Basic Part 50

tailieu.vn

The code shown in Listing 8-33 reveals some of the elegance of using the wait approach. However, it is still not the most efficient code you can write with ADO.NET 2.0. You can change the code shown in Listing 8-33 just a little to gain even more efficiency. The WaitAny method enables you to handle the results of each of...

Professional ASP.NET 3.5 in C# and Visual Basic Part 51

tailieu.vn

New Movie With {.Title = "Shrek", .Director = "Andrew Adamson". .Genre = 0, .ReleaseDate = DateTime.Parse . New Movie With {.Title = "Fletch", .Director = "Michael Ritchie". New Movie With {.Title = "Casablanca", .Director = "Michael Curtiz". .Genre = 1, .ReleaseDate = DateTime.Parse . New Movie With {.Title = "Batman", .Director = "Tim Burton". New Movie With {.Title = "Dances...

Professional ASP.NET 3.5 in C# and Visual Basic Part 52

tailieu.vn

Next, the code uses a very simple LINQ query to select all of the Movie objects from the generic movies collection. Notice that this specific LINQ query utilizes new language keywords like from and select in the query statement. These syntax additions are first class members of the .NET languages, therefore Visual Studio 2008 can offer you development assistance such...

Professional ASP.NET 3.5 in C# and Visual Basic Part 53

tailieu.vn

When running this code, you will see that the results start with the tenth record in the list, and only ten records are displayed.. LINQ to XML. The second flavor of LINQ is called LINQ to XML (or XLINQ). As the name implies, LINQ to XML enables you to use the same basic LINQ syntax to query XML documents. As...

Professional ASP.NET 3.5 in C# and Visual Basic Part 54

tailieu.vn

Me.GridView1.DataBind() End Sub. var query = from m in dc.Movies select m;. this.GridView1.DataSource = query;. this.GridView1.DataBind();. Now, when you debug the Web site using Visual Studio, you can see the SQL query, as shown in Figure 9-11.. Figure 9-11 The SQL query generated by LINQ to SQL. As you can see, the SQL generated is standard SQL syntax, and LINQ...

Professional ASP.NET 3.5 in C# and Visual Basic Part 55

tailieu.vn

Although most of the XML functionality in the .NET Framework appears to be in the System.Xml namespace, you can find XML’s influence throughout the entire Framework including System.Data and System.Web . System.Xml , System.Xml .Linq , and other namespaces contain the .NET Framework 3.5’s view on how programmers should manipulate XML. Oth- ers, like XmlReader and XmlWriter , started in...

Professional ASP.NET 3.5 in C# and Visual Basic Part 56

tailieu.vn

Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs. Dim settings As New XmlReaderSettings() settings.IgnoreWhitespace = True settings.IgnoreComments = True. Dim booksFile As String = Server.MapPath("books.xml"). Using reader As XmlReader = XmlReader.Create(booksFile, settings) While (reader.Read()). If (reader.NodeType = XmlNodeType.Element _ And "book". reader.LocalName) Then bookcount. using System.IO;. using System.Xml;. public partial class _Default : System.Web.UI.Page. settings.IgnoreWhitespace = true;. settings.IgnoreComments...

Professional ASP.NET 3.5 in C# and Visual Basic Part 57

tailieu.vn

XML serialization allows you to add attributes to an existing class that give hints to the XML serialization on how to represent an object as XML. Instead of retrieving the author’s first name and last name using XmlReader.ReadAsString , Listing 10-10 below uses ReadSubtree and a new strongly typed Author class that has been marked up with XML serialization attributes,...

Professional ASP.NET 3.5 in C# and Visual Basic Part 58

tailieu.vn

namespaceMgr.AddNamespace("b http://example.books.com"). Decimal) Response.Write(String.Format("Price is {0}<BR/>",. string booksFile = Server.MapPath("books.xml");. //Add a namespace prefix that can be used in the XPath expression. namespaceMgr.AddNamespace("b http://example.books.com");. Response.Write(String.Format("Price is {0}<BR/>", price));. If you then want to modify the underlying XML nodes, in the form of an XPathNavigator , you would use an XmlDocument instead of an XPathDocument. Listing 10-13 illustrates this change with...

Professional ASP.NET 3.5 in C# and Visual Basic Part 59

tailieu.vn

Regardless of the controversy, XSLT transformations are very useful for changing the structure of XML files quickly and easily, often using a very declarative syntax.. Remember that the Books.xml file used in this chapter is a list of books and their authors. Listing 10-18: Books.xslt. <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform". <xsl:template match gt;. <xsl:element name="Authors">. <xsl:apply-templates select="//book"/>. </xsl:element>. </xsl:template>. <xsl:template match="book">. <xsl:element name="Author">....