You are on page 1of 20

EVENTS.

XML
<Events>
<EventLog Name="Application">
<Information DateTime="3:06 PM 10/7/2002" Source="Process A">
Application Starting
</Information>
<Information DateTime="3:10 PM 10/7/2002" Source="Process B">
Connecting to Network
</Information>
<Warning DateTime="3:11 PM 10/7/2002" Source="Process B">
Network Unavailable...Retrying
</Warning>
<Information DateTime="3:12 PM 10/7/2002" Source="Process A">
Application Shutdown
</Information>
<Error DateTime="3:25 PM 10/7/2002" Source="Process B">
Connection Timeout Exceeded
</Error>
</EventLog>
<EventLog Name="Security"/>
<EventLog Name="System"/>
</Events>

DEFAULT.SKIN
<asp:TreeView SkinId="Bookstore"
NodeStyle-Font-Names="Verdana"
NodeStyle-Font-Size="10pt"
NodeStyle-ForeColor="Black"
RootNodeStyle-Font-Bold="true"
ParentNodeStyle-Font-Italic="true"
ParentNodeStyle-Font-Underline="true"
NodeIndent="10"
runat="server"
/>
<asp:TreeView SkinId="Simple"
Font-Names="Verdana"
ForeColor="Black"
HoverNodeStyle-Font-Underline="true"
HoverNodeStyle-ForeColor="#dd5555"
SelectedNodeStyle-ForeColor="#dd5555"
SelectedNodeStyle-Font-UnderLine="true"
NoExpandImageUrl="images/bullets/square2.gif"
ShowExpandCollapse="true"
NodeIndent="10"
Font-Size="8pt"
runat="server"/>
<asp:TreeView SkinId="Simple2"
Font-Names="Tahoma"
ForeColor="Black"
HoverNodeStyle-Font-Underline="true"
HoverNodeStyle-ForeColor="#5555dd"
SelectedNodeStyle-ForeColor="#5555dd"
SelectedNodeStyle-Font-UnderLine="true"
NoExpandImageUrl="images/bullets/square3.gif"
ShowExpandCollapse="true"

NodeIndent="20"
Font-Size="10pt"
runat="server"/>
<asp:TreeView SkinId="BulletedList"
ForeColor="Black"
Font-Names="Verdana"
HoverNodeStyle-Font-Underline="true"
HoverNodeStyle-ForeColor="#5555dd"
SelectedNodeStyle-ForeColor="#5555dd"
SelectedNodeStyle-Font-UnderLine="true"
RootNodeStyle-ImageUrl="images/bullets/bullet3.gif"
ParentNodeStyle-ImageUrl="images/bullets/bullet3.gif"
LeafNodeStyle-ImageUrl="images/bullets/bullet4.gif"
ShowExpandCollapse="false"
ExpandDepth="100"
NodeIndent="20"
Font-Size="8pt"
runat="server"/>
<asp:TreeView SkinId="BulletedList2"
ForeColor="Black"
Font-Names="Verdana"
HoverNodeStyle-Font-Underline="true"
HoverNodeStyle-ForeColor="#5555dd"
SelectedNodeStyle-ForeColor="#5555dd"
SelectedNodeStyle-Font-UnderLine="true"
RootNodeStyle-ImageUrl="images/bullets/square5.gif"
ParentNodeStyle-ImageUrl="images/bullets/square5.gif"
LeafNodeStyle-ImageUrl="images/bullets/square4.gif"
ShowExpandCollapse="false"
ExpandDepth="100"
NodeIndent="20"
Font-Size="8pt"
runat="server"/>
<asp:TreeView SkinId="BulletedList3"
ForeColor="Black"
Font-Names="Verdana"
HoverNodeStyle-Font-Underline="true"
HoverNodeStyle-ForeColor="#5555dd"
SelectedNodeStyle-ForeColor="#5555dd"
SelectedNodeStyle-Font-UnderLine="true"
RootNodeStyle-ImageUrl="images/bullets/clover3.gif"
ParentNodeStyle-ImageUrl="images/bullets/clover3.gif"
LeafNodeStyle-ImageUrl="images/bullets/clover4.gif"
NodeStyle-HorizontalPadding="5"
ShowExpandCollapse="false"
ExpandDepth="100"
NodeIndent="20"
Font-Size="8pt"
runat="server"/>
<asp:TreeView SkinId="BulletedList4"
ForeColor="Black"
Font-Names="Tahoma"
HoverNodeStyle-Font-Underline="true"
HoverNodeStyle-ForeColor="#5555dd"
SelectedNodeStyle-ForeColor="#5555dd"
SelectedNodeStyle-Font-UnderLine="true"
RootNodeStyle-ImageUrl="images/bullets/bullet3.gif"

ParentNodeStyle-ImageUrl="images/bullets/bullet3.gif"
LeafNodeStyle-ImageUrl="images/bullets/bullet4.gif"
ShowExpandCollapse="false"
ExpandDepth="100"
NodeIndent="20"
Font-Size="10pt"
runat="server"/>
<asp:TreeView SkinId="BulletedList5"
ForeColor="Black"
Font-Names="Tahoma"
HoverNodeStyle-Font-Underline="true"
HoverNodeStyle-ForeColor="#5555dd"
SelectedNodeStyle-ForeColor="#5555dd"
SelectedNodeStyle-Font-UnderLine="true"
RootNodeStyle-ImageUrl="images/bullets/square5.gif"
ParentNodeStyle-ImageUrl="images/bullets/square5.gif"
LeafNodeStyle-ImageUrl="images/bullets/square4.gif"
ShowExpandCollapse="false"
ExpandDepth="100"
NodeIndent="20"
Font-Size="10pt"
runat="server"/>
<asp:TreeView SkinId="BulletedList6"
ForeColor="Black"
Font-Names="Tahoma"
HoverNodeStyle-Font-Underline="true"
HoverNodeStyle-ForeColor="#5555dd"
SelectedNodeStyle-ForeColor="#5555dd"
SelectedNodeStyle-Font-UnderLine="true"
RootNodeStyle-ImageUrl="images/bullets/clover.gif"
ParentNodeStyle-ImageUrl="images/bullets/clover3.gif"
LeafNodeStyle-ImageUrl="images/bullets/clover4.gif"
NodeStyle-HorizontalPadding="5"
ShowExpandCollapse="false"
ExpandDepth="100"
NodeIndent="20"
Font-Size="10pt"
runat="server"/>
<asp:TreeView SkinId="Arrows"
ForeColor="Black"
Font-Names="Verdana"
HoverNodeStyle-Font-Underline="true"
HoverNodeStyle-ForeColor="#5555dd"
SelectedNodeStyle-ForeColor="#5555dd"
SelectedNodeStyle-Font-UnderLine="true"
ExpandImageUrl="images/bullets/right.gif"
CollapseImageUrl="images/bullets/down.gif"
NoExpandImageUrl="images/bullets/right2.gif"
NodeStyle-HorizontalPadding="5"
NodeIndent="20"
Font-Size="8pt"
runat="server"/>
<asp:TreeView SkinId="Arrows2"
ForeColor="Black"
Font-Names="Tahoma"
HoverNodeStyle-Font-Underline="true"
HoverNodeStyle-ForeColor="#5555dd"

SelectedNodeStyle-ForeColor="#5555dd"
SelectedNodeStyle-Font-UnderLine="true"
ExpandImageUrl="images/bullets/right.gif"
CollapseImageUrl="images/bullets/down.gif"
NoExpandImageUrl="images/bullets/right2.gif"
NodeStyle-HorizontalPadding="5"
NodeIndent="20"
Font-Size="10pt"
runat="server"/>
<asp:TreeView SkinId="Help"
NoExpandImageUrl="images/help/blank.gif"
CollapseImageUrl="images/help/minus.gif"
ExpandImageUrl="images/help/plus.gif"
RootNodeStyle-ImageUrl="images/help/openbook.gif"
ParentNodeStyle-ImageUrl="images/help/closedbook.gif"
LeafNodeStyle-ImageUrl="images/help/topic.gif"
NodeStyle-ForeColor="Black"
NodeStyle-Font-Names="Tahoma"
NodeStyle-Font-Size="8pt"
NodeStyle-HorizontalPadding="5"
HoverNodeStyle-ForeColor="Orange"
SelectedNodeStyle-Font-Bold="true"
runat="server"/>
<asp:TreeView SkinId="HelpLines"
ShowLines="true"
LineImagesFolder="themes/default/images/lines"
RootNodeStyle-ImageUrl="images/help/openbook.gif"
ParentNodeStyle-ImageUrl="images/help/closedbook.gif"
LeafNodeStyle-ImageUrl="images/help/topic.gif"
NodeStyle-ForeColor="Black"
NodeStyle-Font-Names="Tahoma"
NodeStyle-Font-Size="8pt"
NodeStyle-HorizontalPadding="5"
HoverNodeStyle-ForeColor="Orange"
SelectedNodeStyle-Font-Bold="true"
runat="server"/>
<asp:TreeView SkinId="Explorer"
RootNodeStyle-ImageUrl="images/explorer/folder.gif"
ParentNodeStyle-ImageUrl="images/explorer/folder.gif"
LeafNodeStyle-ImageUrl="images/explorer/ie.gif"
CollapseImageUrl="images/explorer/minus.gif"
ExpandImageUrl="images/explorer/plus.gif"
NoExpandImageUrl="images/explorer/blank.gif"
NodeStyle-Font-Names="Arial"
NodeStyle-Font-Size="8pt"
NodeStyle-ForeColor="DarkBlue"
NodeStyle-HorizontalPadding="5"
RootNodeStyle-Font-Bold="true"
SelectedNodeStyle-ForeColor="White"
SelectedNodeStyle-BackColor="DarkBlue"
HoverNodeStyle-Font-Underline="true"
runat="server"
/>
<asp:TreeView SkinId="ExplorerLines"
ShowLines="true"
LineImagesFolder="themes/default/images/lines"
RootNodeStyle-ImageUrl="images/explorer/folder.gif"

ParentNodeStyle-ImageUrl="images/explorer/folder.gif"
LeafNodeStyle-ImageUrl="images/explorer/ie.gif"
NodeStyle-Font-Names="Arial"
NodeStyle-Font-Size="8pt"
NodeStyle-ForeColor="DarkBlue"
NodeStyle-HorizontalPadding="5"
RootNodeStyle-Font-Bold="true"
SelectedNodeStyle-ForeColor="White"
SelectedNodeStyle-BackColor="DarkBlue"
HoverNodeStyle-Font-Underline="true"
runat="server"
/>
<asp:TreeView SkinId="TOC"
Font-Names="Verdana"
ForeColor="Black"
HoverNodeStyle-Font-Underline="true"
HoverNodeStyle-ForeColor="#5555dd"
SelectedNodeStyle-ForeColor="#5555dd"
SelectedNodeStyle-Font-UnderLine="true"
ShowExpandCollapse="false"
ExpandDepth="3"
NodeIndent="10"
Font-Size="8pt"
runat="server">
<LevelStyles>
<asp:TreeNodeStyle ChildNodesPadding="5" Font-Bold FontSize="10pt" ForeColor="DarkBlue" />
<asp:TreeNodeStyle ChildNodesPadding="5" Font-UnderLine
Font-Size="10pt" />
<asp:TreeNodeStyle ChildNodesPadding="5" Font-UnderLine />
</LevelStyles>
</asp:TreeView>
<asp:TreeView SkinId="MSDN"
CollapseImageUrl="images/msdn/minus.gif"
ExpandImageUrl="images/msdn/plus.gif"
NoExpandImageUrl="images/msdn/dot.gif"
NodeStyle-ForeColor="Black"
NodeStyle-Font-Names="Verdana"
NodeStyle-Font-Size="8pt"
NodeStyle-HorizontalPadding="5"
HoverNodeStyle-BackColor="#cccccc"
HoverNodeStyle-BorderColor="#888888"
HoverNodeStyle-BorderWidth="1"
HoverNodeStyle-BorderStyle="Solid"
SelectedNodeStyle-BackColor="White"
SelectedNodeStyle-BorderColor="#888888"
SelectedNodeStyle-BorderWidth="1"
SelectedNodeStyle-BorderStyle="Solid"
NodeIndent="10"
runat="server"/>
<asp:TreeView SkinId="News"
Font-Names="Arial"
ForeColor="Black"
Font-Size="10pt"
RootNodeStyle-ImageUrl="images/news/server.gif"
ParentNodeStyle-ImageUrl="images/news/group.gif"
LeafNodeStyle-ImageUrl="images/news/group.gif"
NodeStyle-HorizontalPadding="5"

HoverNodeStyle-Font-UnderLine="true"
SelectedNodeStyle-Font-UnderLine="true"
runat="server"
/>
<asp:TreeView SkinId="Contacts"
Font-Names="Verdana"
ForeColor="Black"
Font-Size="8pt"
ExpandImageUrl="images/contacts/group.gif"
CollapseImageUrl="images/contacts/group.gif"
NoExpandImageUrl="images/contacts/online.gif"
ParentNodeStyle-ForeColor="#5555dd"
ParentNodeStyle-Font-Bold="true"
NodeStyle-HorizontalPadding="5"
SelectedNodeStyle-Font-UnderLine="true"
runat="server"
/>
<asp:TreeView SkinId="Inbox"
Font-Names="Verdana"
ForeColor="Black"
Font-Size="8pt"
RootNodeStyle-ImageUrl="images/outlook/inbox.gif"
ParentNodeStyle-ImageUrl="images/outlook/folder.gif"
LeafNodeStyle-ImageUrl="images/outlook/folder.gif"
NodeStyle-HorizontalPadding="5"
HoverNodeStyle-Font-UnderLine="true"
SelectedNodeStyle-Font-UnderLine="true"
runat="server"
/>
<asp:TreeView SkinId="InboxLines"
Font-Names="Verdana"
ForeColor="Black"
Font-Size="8pt"
ShowLines="true"
LineImagesFolder="themes/default/images/lines"
RootNodeStyle-ImageUrl="images/outlook/inbox.gif"
ParentNodeStyle-ImageUrl="images/outlook/folder.gif"
LeafNodeStyle-ImageUrl="images/outlook/folder.gif"
NodeStyle-HorizontalPadding="5"
HoverNodeStyle-Font-UnderLine="true"
SelectedNodeStyle-Font-UnderLine="true"
runat="server"
/>
<asp:TreeView SkinId="Events"
RootNodeStyle-ImageUrl="images/events/log.gif"
ParentNodeStyle-ImageUrl="images/events/log.gif"
LeafNodeStyle-ImageUrl="images/events/warning.gif"
NodeStyle-HorizontalPadding="5"
HoverNodeStyle-ForeColor="Orange"
SelectedNodeStyle-Font-Bold="true"
SelectedNodeStyle-ForeColor="Orange"
Font-Names="Verdana"
ForeColor="Black"
Font-Size="8pt"
runat="server"
/>

<asp:TreeView SkinId="FAQ"
RootNodeStyle-ImageUrl="images/faq/topic.gif"
ParentNodeStyle-ImageUrl="images/faq/topic.gif"
LeafNodeStyle-ImageUrl="images/faq/question.gif"
NodeStyle-HorizontalPadding="5"
HoverNodeStyle-ForeColor="Purple"
HoverNodeStyle-Font-UnderLine="true"
SelectedNodeStyle-Font-Bold="true"
Font-Names="Tahoma"
ForeColor="DarkBlue"
Font-Size="8pt"
runat="server"
/>

Treeview.aspx
<%@ Page Language="VB" Theme="Default" %>
<%@ Import Namespace="System.Xml" %>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
</head>
<script language="VB" runat="server">
Sub MyTreeView_SelectedNodeChanged(sender As Object, e As
EventArgs)
Dim path As String = MyTreeView.SelectedNode.DataPath
MyDetailsSource.XPath = path
MyDataList.DataSource = MyDetailsSource
MyDataList.DataBind()
End Sub
</script>
<body>
<div>
<h2>TreeView Event Viewer</h2>
<form action="treeview19_evtlog4_vb.aspx" runat="server">
<table width="600px">
<tr>
<td valign="top">
<asp:XmlDataSource ID="MySource"
DataFile="~/App_Data/Events.xml" XPath="Events/EventLog"
runat="server"/>
<asp:TreeView ID="MyTreeView"
SkinId="Events"
DataSourceId="MySource"
MaxDataBindDepth="1"
OnSelectedNodeChanged="MyTreeView_SelectedNodeChanged"
runat="server">
<Databindings>
<asp:TreeNodeBinding DataMember="EventLog"
TextField="Name" ImageUrl="~/images/events/log.gif"
SelectAction="Expand" />

<asp:TreeNodeBinding DataMember="Information"
ImageUrl="~/images/events/info.gif" TextField="DateTime"/>
<asp:TreeNodeBinding DataMember="Error"
ImageUrl="~/images/events/error.gif" TextField="DateTime"/>
<asp:TreeNodeBinding DataMember="Warning"
ImageUrl="~/images/events/warning.gif" TextField="DateTime"/>
</Databindings>
</asp:TreeView>
</td>
<td valign="top">
<asp:XmlDataSource Id="MyDetailsSource"
DataFile="~/App_Data/Events.xml" runat="server"/>
<asp:DataList Id="MyDataList" runat="server">
<ItemTemplate>
<span style="font: 10pt verdana;"><u><b>Event
Details</b></u></span>
<table width="350px" style="font: 8pt verdana">
<tr><td><b>Date:</b></td><td><%#
DateTime.Parse(XPath("@DateTime")).ToString("d") %></td></tr>
<tr><td><b>Time:</b></td><td><%#
DateTime.Parse(XPath("@DateTime")).ToString("t") %></td></tr>
<tr><td><b>Source:</b></td><td><%#
XPath("@Source") %></td></tr>
<tr><td><b>Message:</b></td><td><%#
XPath("text()") %></td></tr>
<tr><td><b>Type:</b></td><td><%# XPath("name()")
%></td></tr>
</table>
</ItemTemplate>
</asp:DataList>
</td>
</tr>
</table>
</form>
</div>
</body>
</html>

ESCENARIOS
<%@ Page Language="VB" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head id="Head1" runat="server">
<title>EmptyDataTemplate, NullDisplayText, DefaultValue, and
ConvertEmptyStringToNull</title>
</head>
<body>
<form id="form1" runat="server">
<div>
<strong>View contacts that begin with:</strong><br />

<br />
<asp:ListBox AutoPostBack="True" ID="ListBox1" runat="server"
Width="114px">
<asp:ListItem Selected="true">A</asp:ListItem>
<asp:ListItem>B</asp:ListItem>
<asp:ListItem>C</asp:ListItem>
<asp:ListItem>D</asp:ListItem>
<asp:ListItem>E</asp:ListItem>
<asp:ListItem>F</asp:ListItem>
<asp:ListItem>G</asp:ListItem>
<asp:ListItem>H</asp:ListItem>
<asp:ListItem>I</asp:ListItem>
<asp:ListItem>J</asp:ListItem>
<asp:ListItem>K</asp:ListItem>
<asp:ListItem>L</asp:ListItem>
<asp:ListItem>M</asp:ListItem>
<asp:ListItem>N</asp:ListItem>
<asp:ListItem>O</asp:ListItem>
<asp:ListItem>P</asp:ListItem>
<asp:ListItem>Q</asp:ListItem>
<asp:ListItem>R</asp:ListItem>
<asp:ListItem>S</asp:ListItem>
<asp:ListItem>T</asp:ListItem>
<asp:ListItem>U</asp:ListItem>
<asp:ListItem>V</asp:ListItem>
<asp:ListItem>W</asp:ListItem>
<asp:ListItem>X</asp:ListItem>
<asp:ListItem>Y</asp:ListItem>
<asp:ListItem>Z</asp:ListItem>
</asp:ListBox><br />
<br />
<asp:DetailsView AutoGenerateRows="False"
DataKeyNames="CustomerID" DataSourceID="SqlDataSource1"
Height="50px" ID="DetailsView1" runat="server" Width="315px"
AllowPaging="True">
<Fields>
<asp:BoundField DataField="ContactName"
HeaderText="ContactName" SortExpression="ContactName"
ReadOnly="true" />
<asp:BoundField DataField="ContactTitle"
HeaderText="ContactTitle" SortExpression="ContactTitle" />
<asp:BoundField DataField="Region" HeaderText="Region"
NullDisplayText="(NA)" SortExpression="Region" />
<asp:BoundField DataField="Phone" HeaderText="Phone"
NullDisplayText="not listed"
SortExpression="Phone" />
<asp:BoundField DataField="Fax" HeaderText="Fax"
NullDisplayText="not listed" SortExpression="Fax" />
<asp:CommandField ShowEditButton="True" />
</Fields>
<EmptyDataTemplate>
<asp:Image ID="Image1" runat="server"
ImageUrl="~/Images/warning.gif" />There are no records to display
</EmptyDataTemplate>
</asp:DetailsView>
<asp:SqlDataSource ConnectionString="<%$
ConnectionStrings:Northwind %>" ID="SqlDataSource1"
runat="server" SelectCommand="SELECT [CustomerID],
[ContactName], [ContactTitle], [Region], [Phone], [Fax] FROM
[Customers] WHERE ([ContactName] LIKE + @ContactName + '%')"

UpdateCommand="UPDATE [Customers] SET [ContactTitle] =


@ContactTitle, [Region] = @Region, [Phone] = @Phone, [Fax] = @Fax
WHERE [CustomerID] = @CustomerID">
<UpdateParameters>
<asp:Parameter Name="ContactName" Type="String" />
<asp:Parameter Name="ContactTitle" Type="String"
DefaultValue="Owner" ConvertEmptyStringToNull="true" />
<asp:Parameter Name="Region" Type="String"
ConvertEmptyStringToNull="true" />
<asp:Parameter Name="Phone" Type="String"
ConvertEmptyStringToNull="true" />
<asp:Parameter Name="Fax" Type="String"
ConvertEmptyStringToNull="true" />
<asp:Parameter Name="CustomerID" Type="String" />
</UpdateParameters>
<SelectParameters>
<asp:ControlParameter ControlID="ListBox1"
Name="ContactName" PropertyName="SelectedValue"
Type="String" />
</SelectParameters>
</asp:SqlDataSource>
</div>
</form>
</body>
</html>

ESCENARIO2
<%@ Page Language="VB" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<script runat="server">
Protected Sub FormView1_DataBound(ByVal sender As Object, ByVal e As
System.EventArgs)
OrderDetailsDataSource.SelectParameters("OrderID").DefaultValue =
FormView1.DataItem("OrderID")
End Sub
</script>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title>Nested Master Details</title>
</head>
<body>
<form id="form1" runat="server">
<div><h2>Orders and Order Details</h2>
<asp:FormView AllowPaging="True" DataKeyNames="OrderID"
DataSourceID="OrdersDataSource"
ID="FormView1" OnDataBound="FormView1_DataBound"
runat="server">
<ItemTemplate>
<b>OrderID:</b>
<asp:Label ID="OrderIDLabel" runat="server" Text='<%#
Eval("OrderID") %>'></asp:Label><br />
<b>OrderDate:</b>
<asp:Label ID="OrderDateLabel" runat="server" Text='<%#
Eval("OrderDate") %>'></asp:Label><br />
<b>ShipCity:</b>

<asp:Label ID="ShipCityLabel" runat="server" Text='<%#


Eval("ShipCity") %>'></asp:Label><br />
<b>ShipCountry:</b>
<asp:Label ID="ShipCountryLabel" runat="server" Text='<%#
Eval("ShipCountry") %>'></asp:Label><br />
<br />
<asp:GridView AutoGenerateColumns="False"
DataSourceID="OrderDetailsDataSource" ID="GridView1"
runat="server">
<Columns>
<asp:BoundField DataField="OrderID" HeaderText="OrderID"
SortExpression="OrderID" />
<asp:BoundField DataField="ProductName"
HeaderText="ProductName" SortExpression="ProductName" />
<asp:BoundField DataField="UnitPrice"
HeaderText="UnitPrice" SortExpression="UnitPrice" />
<asp:BoundField DataField="Quantity"
HeaderText="Quantity" SortExpression="Quantity" />
</Columns>
</asp:GridView>
</ItemTemplate>
<PagerSettings Position="Top" Mode="NextPrevious"
NextPageText="Next Order &amp;gt;&amp;gt;"
PreviousPageText="&amp;lt;&amp;lt; Previous Order" />
<PagerStyle Font-Size="0.7em" />
</asp:FormView>
<asp:SqlDataSource ConnectionString="<%$
ConnectionStrings:Northwind %>" ID="OrdersDataSource"
runat="server" SelectCommand="SELECT [OrderID], [OrderDate],
[ShipCity], [ShipCountry] FROM [Orders]">
</asp:SqlDataSource>
<asp:SqlDataSource ConnectionString="<%$
ConnectionStrings:Northwind %>" ID="OrderDetailsDataSource"
runat="server" SelectCommand="SELECT [Order Details].OrderID,
Products.ProductName, [Order Details].UnitPrice, [Order
Details].Quantity FROM [Order Details] INNER JOIN Products ON [Order
Details].ProductID = Products.ProductID WHERE [Order Details].OrderID
= @OrderID">
<SelectParameters>
<asp:Parameter Name="OrderID" />
</SelectParameters>
</asp:SqlDataSource>
</div>
</form>
</body>
</html>

ESCENARIO3
<%@ Page Language="VB" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<script runat="server">
Protected Sub DataList1_ItemDataBound(ByVal sender As Object, ByVal
e As System.Web.UI.WebControls.DataListItemEventArgs)
Dim s As SqlDataSource =
e.Item.FindControl("OrderDetailsDataSource")

s.SelectParameters("OrderID").DefaultValue =
e.Item.DataItem("OrderID")
End Sub
</script>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title>Nested Master Details List</title>
</head>
<body>
<form id="form1" runat="server">
<div>
<h2>
Orders and Order Details</h2>
<asp:DataList DataKeyField="OrderID"
DataSourceID="OrdersDataSource" ID="DataList1" GridLines="Both"
CellPadding="15"
OnItemDataBound="DataList1_ItemDataBound" runat="server">
<AlternatingItemStyle BackColor="AntiqueWhite" />
<ItemTemplate>
<b>OrderID:</b>
<asp:Label ID="OrderIDLabel" runat="server" Text='<%#
Eval("OrderID") %>'></asp:Label><br />
<b>OrderDate:</b>
<asp:Label ID="OrderDateLabel" runat="server" Text='<%#
Eval("OrderDate") %>'></asp:Label><br />
<b>ShipCity:</b>
<asp:Label ID="ShipCityLabel" runat="server" Text='<%#
Eval("ShipCity") %>'></asp:Label><br />
<b>ShipCountry:</b>
<asp:Label ID="ShipCountryLabel" runat="server" Text='<%#
Eval("ShipCountry") %>'></asp:Label><br />
<br />
<asp:GridView AutoGenerateColumns="False"
DataSourceID="OrderDetailsDataSource" ID="GridView1"
runat="server" Width="100%">
<Columns>
<asp:BoundField DataField="OrderID" HeaderText="OrderID"
SortExpression="OrderID" />
<asp:BoundField DataField="ProductName"
HeaderText="ProductName" SortExpression="ProductName" />
<asp:BoundField DataField="UnitPrice"
HeaderText="UnitPrice" SortExpression="UnitPrice" />
<asp:BoundField DataField="Quantity"
HeaderText="Quantity" SortExpression="Quantity" />
</Columns>
</asp:GridView>
<br /><br />
<asp:SqlDataSource ConnectionString="<%$
ConnectionStrings:Northwind %>" ID="OrderDetailsDataSource"
runat="server" SelectCommand="SELECT [Order
Details].OrderID, Products.ProductName, [Order Details].UnitPrice,
[Order Details].Quantity FROM [Order Details] INNER JOIN Products ON
[Order Details].ProductID = Products.ProductID WHERE [Order
Details].OrderID = @OrderID">
<SelectParameters>
<asp:Parameter Name="OrderID" />
</SelectParameters>
</asp:SqlDataSource>
</ItemTemplate>
</asp:DataList>

<asp:SqlDataSource ConnectionString="<%$
ConnectionStrings:Northwind %>" ID="OrdersDataSource"
runat="server" SelectCommand="SELECT [OrderID], [OrderDate],
[ShipCity], [ShipCountry] FROM [Orders]">
</asp:SqlDataSource>
</div>
</form>
</body>
</html>

PAGINACION
<%@ Page Language="VB" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title>PagerTemplate</title>
</head>
<body>
<form id="form1" runat="server">
<div>
<asp:GridView AllowPaging="True" AutoGenerateColumns="False"
DataKeyNames="au_id"
DataSourceID="SqlDataSource1" ID="GridView1" runat="server">
<Columns>
<asp:BoundField DataField="au_id" HeaderText="au_id"
ReadOnly="True" SortExpression="au_id" />
<asp:BoundField DataField="au_lname" HeaderText="au_lname"
SortExpression="au_lname" />
<asp:BoundField DataField="au_fname" HeaderText="au_fname"
SortExpression="au_fname" />
<asp:BoundField DataField="state" HeaderText="state"
SortExpression="state" />
</Columns>
<PagerTemplate>
<asp:LinkButton CommandName="Page" CommandArgument="First"
ID="LinkButton1" runat="server" Style="color: white">&lt;&lt;
First</asp:LinkButton>
<asp:LinkButton CommandName="Page" CommandArgument="Prev"
ID="LinkButton2" runat="server" Style="color: white">&lt;
Prev</asp:LinkButton>
[Records <%= GridView1.PageIndex * GridView1.PageSize %> - <
%= GridView1.PageIndex * GridView1.PageSize + GridView1.PageSize - 1
%>]
<asp:LinkButton CommandName="Page" CommandArgument="Next"
ID="LinkButton3" runat="server" Style="color: white">Next
&gt;</asp:LinkButton>
<asp:LinkButton CommandName="Page" CommandArgument="Last"
ID="LinkButton4" runat="server" Style="color: white">Last
&gt;&gt;</asp:LinkButton>
</PagerTemplate>
</asp:GridView>
<asp:SqlDataSource ConnectionString="<%$ ConnectionStrings:Pubs
%>" ID="SqlDataSource1"
runat="server" SelectCommand="SELECT [au_id], [au_lname],
[au_fname], [state] FROM [authors]">
</asp:SqlDataSource>
&nbsp;<br />

<asp:DetailsView AllowPaging="True" AutoGenerateRows="False"


DataKeyNames="au_id"
DataSourceID="SqlDataSource1" Height="50px" ID="DetailsView1"
runat="server" Width="399px" HeaderText="Author Details">
<Fields>
<asp:BoundField DataField="au_id" HeaderText="au_id"
ReadOnly="True" SortExpression="au_id" />
<asp:BoundField DataField="au_lname" HeaderText="au_lname"
SortExpression="au_lname" />
<asp:BoundField DataField="au_fname" HeaderText="au_fname"
SortExpression="au_fname" />
<asp:BoundField DataField="state" HeaderText="state"
SortExpression="state" />
</Fields>
<PagerTemplate>
<asp:LinkButton CommandName="Page" CommandArgument="First"
ID="LinkButton1" runat="server" Style="color: white">&lt;&lt;
First</asp:LinkButton>
<asp:LinkButton CommandName="Page" CommandArgument="Prev"
ID="LinkButton2" runat="server" Style="color: white">&lt;
Prev</asp:LinkButton>
[Record <%= DetailsView1.DataItemIndex %> of <%=
DetailsView1.PageCount - 1 %>]
<asp:LinkButton CommandName="Page" CommandArgument="Next"
ID="LinkButton3" runat="server" Style="color: white">Next
&gt;</asp:LinkButton>
<asp:LinkButton CommandName="Page" CommandArgument="Last"
ID="LinkButton4" runat="server" Style="color: white">Last
&gt;&gt;</asp:LinkButton>
</PagerTemplate>
</asp:DetailsView>
</div>
</form>
</body>
</html>

MASTER PAGE
SITE.MASTERPAGE
<%@ master language="VB" %>
<html>
<head>
<link rel="stylesheet" href="StyleSheet.css" type="text/css" />
</head>
<body>
<form id="Form1" runat="server">
<div>
<table class="main" cellspacing="0" cellpadding="2">
<tr class="header">
<td colspan="2" class="header"/>
</tr>
<tr valign="top">
<td class="sidebar" rowspan="2">
<a href="daffodil.aspx">Daffodil</a><br/>
<a href="rose.aspx">Rose</a><br/>
<a href="dahlia.aspx">Dahlia</a><br/>
<a href="hydrangea.aspx">Hydrangea</a><br/>
<a href="daisy.aspx">Daisy</a><br />
</td>

runat="server">

<td class="body">
<asp:contentplaceholder id="FlowerText"

<h3>Welcome to my florist website!</h3>


We have an enormous selection of quality
flowers and seeds, available for shipping to any location worldwide.
Let us handle all you gardening needs!
</asp:contentplaceholder>
<br /><br />
<asp:contentplaceholder id="FlowerPicture"
runat="server">
<img alt="water lilies"
src="./Images/waterlilies.jpg"/>
</asp:contentplaceholder>
<br /><br />
<asp:adrotator id="MyAdRotator"
advertisementfile="Ads.xml" runat="server"/>
</td>
</tr>
<tr>
<td class="footer">
<asp:label id="Footer" font-italic="true"
text="Copyright Microsoft 2003" runat="server" />
</td>
</tr>
</table>
</div>
</form>
</body>
</html>

DEFAULT.aspx

<%@ page language="VB" masterpagefile="./Site.master" %>

ROSE.aspx

<%@ page language="VB" masterpagefile="./Site.master" %>


<asp:content id="Content1" contentplaceholderid="FlowerText"
runat="server">
With sunshine, water, and careful tending, roses will bloom
several times in a season.
</asp:content>
<asp:content id="Content2" contentplaceholderid="FlowerPicture"
runat="server">
<img alt="rose" src="images/rose.jpg" />
</asp:content>

SITE2.MASTER
<%@ master language="VB" %>
<html>
<head runat="server">
<link rel="stylesheet" href="StyleSheet.css" type="text/css" />
</head>
<body>

<form id="Form1" runat="server">


<div>
<table class="main" cellspacing="0" cellpadding="2">
<tr class="header">
<td colspan="2" class="header"/>
</tr>
<tr valign="top">
<td class="sidebar" rowspan="2">
<a id="A1" href="pages/daffodil.aspx"
runat="server">Daffodil</a><br/>
<a id="A2" href="pages/rose.aspx"
runat="server">Rose</a><br/>
<a id="A3" href="pages/dahlia.aspx"
runat="server">Dahlia</a><br/>
<a id="A4" href="pages/hydrangea.aspx"
runat="server">Hydrangea</a><br/>
<a id="A5" href="pages/daisy.aspx"
runat="server">Daisy</a><br />
</td>
<td class="body">
<asp:contentplaceholder id="FlowerText"
runat="server">
<h3>Welcome to my florist website!</h3>
We have an enormous selection of quality
flowers and seeds, available for shipping to any location worldwide.
Let us handle all you gardening needs!
</asp:contentplaceholder>
<br /><br />
<asp:contentplaceholder id="FlowerPicture"
runat="server">
<asp:Image ID="Image1" AlternateText="Water
Lillies" ImageUrl="./Images/Waterlilies.jpg" runat="server"/>
</asp:contentplaceholder>
<br /><br />
<asp:adrotator id="MyAdRotator"
advertisementfile="Ads.xml" runat="server"/>
</td>
</tr>
<tr>
<td class="footer">
<asp:label id="Footer" font-italic="true"
text="Copyright Microsoft 2003" runat="server" />
</td>
</tr>
</table>
</div>
</form>
</body>
</html>

DEFAULT.ASPX
<%@ page language="VB" masterpagefile="../Site2.master" %>

ROSE.aspx
<%@ page language="VB" masterpagefile="../Site2.master" %>

<asp:content id="Content1" contentplaceholderid="FlowerText"


runat="server">
With sunshine, water, and careful tending, roses will bloom
several times in a season.
</asp:content>
<asp:content id="Content2" contentplaceholderid="FlowerPicture"
runat="server">
<asp:Image id="image1" imageurl="../images/rose.jpg"
runat="server"/>
</asp:content>

SITE3.MASTER
<%@ master language="VB" %>
<script runat="server">
Public Property FooterText() As String
Get
return Footer.Text
End Get
Set(ByVal value As String)
Footer.Text = value
End Set
End Property
</script>
<html>
<head runat="server">
<link rel="stylesheet" href="StyleSheet.css" type="text/css" />
</head>
<body>
<form id="Form1" runat="server">
<div>
<table class="main" cellspacing="0" cellpadding="2">
<tr class="header">
<td colspan="2" class="header"/>
</tr>
<tr valign="top">
<td class="sidebar" rowspan="2">
<a id="A1" href="pages/daffodil.aspx"
runat="server">Daffodil</a><br/>
<a id="A2" href="pages/rose.aspx"
runat="server">Rose</a><br/>
<a id="A3" href="pages/dahlia.aspx"
runat="server">Dahlia</a><br/>
<a id="A4" href="pages/hydrangea.aspx"
runat="server">Hydrangea</a><br/>
<a id="A5" href="pages/daisy.aspx"
runat="server">Daisy</a><br />
</td>
<td class="body">
<asp:contentplaceholder id="FlowerText"
runat="server">
<h3>Welcome to my florist website!</h3>
We have an enormous selection of quality
flowers and seeds, available for shipping to any location worldwide.
Let us handle all you gardening needs!
</asp:contentplaceholder>

runat="server">

<br /><br />


<asp:contentplaceholder id="FlowerPicture"

<asp:Image ID="Image1" AlternateText="Water


Lillies" ImageUrl="./Images/Waterlilies.jpg" runat="server"/>
</asp:contentplaceholder>
<br /><br />
<asp:adrotator id="MyAdRotator"
advertisementfile="Ads.xml" runat="server"/>
</td>
</tr>
<tr>
<td class="footer">
<asp:label id="Footer" font-italic="true"
text="Copyright Microsoft 2003" runat="server" />
</td>
</tr>
</table>
</div>
</form>
</body>
</html>

ROSECODE.aspx

<%@ page language="VB" masterpagefile="../Site3.master" %>


<%@ mastertype virtualpath="../Site3.master" %>
<script runat="server">
Sub Page_Load()
Master.FooterText = "This is a custom footer"
Dim ad As AdRotator = Master.FindControl("MyAdRotator")
If (Not ad Is Nothing)
ad.BorderColor = System.Drawing.Color.Purple
ad.BorderWidth = 10
End If
End Sub
</script>
<asp:content id="Content1" contentplaceholderid="FlowerText"
runat="server">
With sunshine, water, and careful tending, roses will bloom
several times in a season.
</asp:content>
<asp:content id="Content2" contentplaceholderid="FlowerPicture"
runat="server">
<asp:Image id="image1" imageurl="../images/rose.jpg"
runat="server"/>
</asp:content>

ROSE.aspx
<%@ page language="VB" classname="Rose"
masterpagefile="../SectionPerrenials.master" %>

<asp:content id="FlowerText" ContentPlaceHolderId="FlowerText"


runat="server">
With sunshine, water, and careful tending, roses will bloom
several times in a season.
</asp:content>
<asp:content id="FlowerPicture" ContentPlaceHolderId="FlowerPicture"
runat="server">
<asp:image id="image1" runat=server
imageurl="../images/rose.jpg"/>
</asp:content>

PETUNIA.aspx

<%@ page language="VB" masterpagefile="../SectionAnnuals.master" %>


<asp:content id="FlowerText" ContentPlaceHolderId="FlowerText"
runat="server">
Petunias are available in many colorful varieties, and add punch
to your garden.
</asp:content>
<asp:content id="FlowerPicture" ContentPlaceHolderId="FlowerPicture"
runat="server">
<asp:image id="image1" runat=server
imageurl="../images/petunia.jpg"/>
</asp:content>

SITE4.MASTER
<%@ master language="VB" %>
<html>
<head runat="server">
<link rel="stylesheet" href="StyleSheet.css" type="text/css" />
</head>
<body>
<form id="Form1" runat="server">
<div>
<table class="main" cellspacing="0" cellpadding="2">
<tr class="header">
<td colspan="2" class="header"/>
</tr>
<tr valign="top">
<td class="sidebar" rowspan="2">
<a id="A1" href="home.aspx"
runat="server">Home</a><br/>
<h4>Perrenials</h4>
<a id="A2" href="perrenials/daffodil.aspx"
runat="server">Daffodil</a><br/>
<a id="A3" href="perrenials/rose.aspx"
runat="server">Rose</a><br/>
<a id="A4" href="perrenials/dahlia.aspx"
runat="server">Dahlia</a><br/>
<a id="A5" href="perrenials/hydrangea.aspx"
runat="server">Hydrangea</a><br/>
<a id="A6" href="perrenials/daisy.aspx"
runat="server">Daisy</a><br />
<h4>Annuals</h4>
<a id="A7" href="annuals/gerranium.aspx"
runat="server">Gerranium</a><br/>
<a id="A8" href="annuals/impatiens.aspx"
runat="server">Impatiens</a><br/>
<a id="A9" href="annuals/petunia.aspx"
runat="server">Petunia</a><br/>
</td>
<td class="body">

<asp:ContentPlaceHolder id="SectionContents"
runat="server">

<h3>Welcome to my florist website!</h3>


We have an enormous selection of quality
flowers and seeds, available for shipping to any location worldwide.
Let us handle all you gardening needs!<br/><br/>
<asp:Image ID="Image1" AlternateText="Water
Lillies" ImageUrl="./Images/Waterlilies.jpg" runat="server"/>
</asp:ContentPlaceHolder>
</td>
</tr>
<tr>
<td class="footer">
<asp:label id="Footer" font-italic="true"
text="Copyright Microsoft 2003" runat="server" />
</td>
</tr>
</table>
</div>
</form>
</body>
</html>

SECCTIONPERRENIALS.MASTER

<%@ master language="VB" masterpagefile="./Site4.master"%>


<asp:content contentplaceholderid="SectionContents" runat="server">
<h3>Perrenials</h3>
<asp:contentplaceholder id="FlowerText" runat="server"/>
<br /><br />
<asp:contentplaceholder id="FlowerPicture" runat="server"/>
</asp:content>

SECCTIONANNUAL.MASTER

<%@ master language="VB" masterpagefile="./Site4.master"%>


<asp:content contentplaceholderid="SectionContents" runat="server">
<h3>Annuals</h3>
<asp:contentplaceholder id="FlowerText" runat="server"/>
<br /><br />
<asp:contentplaceholder id="FlowerPicture" runat="server"/>
</asp:content>

HOME.aspx

<%@ page language="VB" MasterPageFile="./Site4.master" %>

You might also like