CS1061: “ASP.controlcache_aspx”不包含“SqlDataSource_Selected”的定义,
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="ControlCache.aspx.cs" Inherits="ControlCache" %><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.
<html xmlns="http://www.
<head runat="server">
<title></title>
</head>
<body>
<form id="form1" runat="server">
<div>
</div>
<asp:Literal ID="Literal1" runat="server"></asp:Literal>
<asp:Literal ID="Literal2" runat="server"></asp:Literal>
<asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False"
DataSourceID="SqlDataSource2">
<Columns>
<asp:BoundField DataField="username" HeaderText="username"
SortExpression="username" />
<asp:BoundField DataField="password" HeaderText="password"
SortExpression="password" />
</Columns>
</asp:GridView>
<asp:SqlDataSource ID="SqlDataSource2" runat="server"
ConnectionString="<%$ ConnectionStrings:AdventureWorksConnectionString2 %>"
SelectCommand="SELECT * FROM [Location]"
CacheDuration="10"
EnableCaching="true"
OnSelecting="SqlDataSource2_Selecting"
>
</asp:SqlDataSource>
</form>
</body>
</html>