我剛開始學習ASP.net,我似乎無法在編譯GridView時正確顯示自己。在設計視圖中使用Visual Studio '08,它顯示它很好,但是當我編譯時,它不存在。DataGrid在設計窗口中顯示,但不在網頁中
<%@ Page Language="vb" AutoEventWireup="false" CodeBehind="Default.aspx.vb" Inherits="WebAppTest._Default" %>
<!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>Untitled Page</title>
</head>
<body>
<form runat="server">
<div>
<asp:GridView id ="gridview1" runat ="server" AutoGenerateColumns = "False" BackColor="White" BorderColor="#CCCCCC" BorderStyle="None" BorderWidth="1px" CellPadding="3" >
<RowStyle ForeColor="#000066" />
<Columns>
<asp:BoundField HeaderText="Test1" />
<asp:BoundField HeaderText="Test2" />
<asp:TemplateField HeaderText="Pick one">
<ItemTemplate>
<asp:RadioButton ID="rbut1" runat="server" GroupName="test"/>
</ItemTemplate>
<ItemStyle HorizontalAlign="Center" VerticalAlign="Middle" />
</asp:TemplateField>
</Columns>
<FooterStyle BackColor="White" ForeColor="#000066" />
<PagerStyle BackColor="White" ForeColor="#000066" HorizontalAlign="Left" />
<SelectedRowStyle BackColor="#669999" Font-Bold="True" ForeColor="White" />
<HeaderStyle BackColor="#006699" Font-Bold="True" ForeColor="White" />
</asp:GridView>
</div>
</form>
</body>
</html>
你的數據源在哪裏? – 2009-10-20 02:19:29