在母版页中使用gridview

时间:2011-04-14 13:00:00

标签: asp.net vb.net gridview visual-studio-2005 master-pages

我在VS2005(VB)中创建了一个新页面并且它有一个gridview,我的问题是当我尝试将网格插入到ContentPlaceHolder中时(在设计模式下)它最终会在页面上的其他位置结束。我正在使用一个主页,但不确定我做错了什么。

ASPX代码

<%@ Page Language="vb" MasterPageFile="~/secure/Master1.Master" CodeBehind="Master1.Master.vb" Inherits="Main.LiveCalendar" %>

<asp:Content ID="ContentPlaceHolder" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">

<h1>Live Calendar</h1>

        <%--<asp:Label runat="server" id="lblMessage" Text=""></asp:Label>--%>
        <asp:gridview id="GridView1" runat="server" allowsorting="True" autogeneratecolumns="False"
                datasourceid="SqlDataSource1" style="z-index: 100; left: 0px; position: absolute;
                top: 0px" Height="101px" Width="224px"><Columns>
        <asp:BoundField DataField="P_AE_ID" SortExpression="P_AE_ID" HeaderText="P_AE_ID"></asp:BoundField>
        <asp:BoundField DataField="P_Name" SortExpression="P_Name" HeaderText="P_Name"></asp:BoundField>
        <asp:BoundField DataField="P_Start" SortExpression="P_Start" HeaderText="P_Win_Start"></asp:BoundField>
        <asp:BoundField DataField="P_End" SortExpression="P_End" HeaderText="P_Win_End"></asp:BoundField>
        <asp:BoundField DataField="P_Status" SortExpression="P_Status" HeaderText="P_Status"></asp:BoundField>
        <asp:BoundField ReadOnly="True" DataField="CountOfPED_ID" SortExpression="CountOfPED_ID" HeaderText="CountOfPED_ID"></asp:BoundField>
        </Columns>
        </asp:gridview>
        <p>
            &nbsp;<asp:sqldatasource id="SqlDataSource1" runat="server" connectionstring="<%$ ConnectionStrings:dbConnection %>"
                selectcommand="web_Public" selectcommandtype="StoredProcedure"></asp:sqldatasource>

        </p>


</asp:Content>

1 个答案:

答案 0 :(得分:0)

我并不完全明白你的意思 “它最终会在页面上的其他地方结束” 但如果你的问题与网格的位置有关,则改变其z-index和位置属性