<asp:GridView ID="ListOfServers" runat="server" AllowPaging="True" AllowSorting="True" AutoGenerateColumns="False" BorderStyle="Solid" BorderWidth="2px" CaptionAlign="Bottom" CellPadding="4" DataKeyNames="ServerID" DataSourceID="SqlDataSource1" Font-Bold="True" Font-Names="Cordia New" Font-Size="Medium" ForeColor="#333333" HorizontalAlign="Center" ToolTip="This table contains the current list of monitored servers." Width="95%"> <RowStyle BackColor="#EFF3FB" /> <Columns> <asp:CommandField ShowSelectButton="True" /> <asp:BoundField DataField="ServerID" HeaderText="ServerID" InsertVisible="False" ReadOnly="True" SortExpression="ServerID" /> <asp:BoundField DataField="HostName" HeaderText="HostName" SortExpression="HostName" /> <asp:BoundField DataField="MachineType" HeaderText="MachineType" SortExpression="MachineType" /> <asp:BoundField DataField="Kernel" HeaderText="Kernel" SortExpression="Kernel" /> <asp:BoundField DataField="SerialNo" HeaderText="SerialNo" SortExpression="SerialNo" /> <asp:BoundField DataField="PrimaryIP" HeaderText="PrimaryIP" SortExpression="PrimaryIP" /> </Columns> <FooterStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" /> <PagerStyle BackColor="#2461BF" ForeColor="White" HorizontalAlign="Center" /> <SelectedRowStyle BackColor="#D1DDF1" Font-Bold="True" ForeColor="#333333" /> <HeaderStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" /> <EditRowStyle BackColor="#2461BF" HorizontalAlign="Center" VerticalAlign="Middle" Wrap="True" /> <AlternatingRowStyle BackColor="White" /> </asp:GridView>
<asp:TemplateField HeaderText="Action"> <ItemTemplate> <asp:Label ID="lblEdit" runat="server" Text='<%# "<a href=frmAgents.aspx?Cmd=EDIT&NavigateId=" + DataBinder.Eval(Container.DataItem, "Id")+ ">Edit</a>"+" | "+ "<a onclick="+ch+"return ConfirmChoice()"+ ch +" href=frmAgents.aspx?Cmd=DELETE&NavigateId=" + DataBinder.Eval(Container.DataItem, "Id")+ ">Delete</a>" %>'></asp:Label> </ItemTemplate> <ItemStyle HorizontalAlign="Center" /> <HeaderStyle HorizontalAlign="Center" /> </asp:TemplateField>
Error 10 'System.Web.UI.Control' does not contain a definition for 'DataItem' and no extension method 'DataItem' accepting a first argument of type 'System.Web.UI.Control' could be found (are you missing a using directive or an assembly reference?) C:\Users\chris\Documents\work\uni\year3\project\website\Home.aspx 54
<%@ Page Language="C#" MasterPageFile="~/Master1.master" AutoEventWireup="true" CodeFile="Home.aspx.cs" Inherits="Home" Title="Site Health Home Page" %> <%@ MasterType virtualpath="~/Master1.master" %> <asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server"> <h1 style="text-align: center; color: #FFFFFF;"> <asp:Label ID="CompanyName" runat="server" style="font-size: x-large" Text="Label"></asp:Label> </h1> <p> You are currenlty monitoring <asp:Label ID="serverCount" runat="server" Text="servercount"></asp:Label> Solaris Servers:</p> <p> <asp:GridView ID="ListOfServers" runat="server" AllowPaging="True" AllowSorting="True" AutoGenerateColumns="False" BorderStyle="Solid" BorderWidth="2px" CaptionAlign="Bottom" CellPadding="4" DataKeyNames="ServerID" DataSourceID="SqlDataSource1" Font-Bold="True" Font-Names="Cordia New" Font-Size="Medium" ForeColor="#333333" HorizontalAlign="Center" ToolTip="This table contains the current list of monitored servers." Width="95%"> <RowStyle BackColor="#EFF3FB" /> <Columns> <asp:CommandField ShowSelectButton="True" /> <asp:BoundField DataField="ServerID" HeaderText="ServerID" InsertVisible="False" ReadOnly="True" SortExpression="ServerID" /> <asp:BoundField DataField="HostName" HeaderText="HostName" SortExpression="HostName" /> <asp:BoundField DataField="MachineType" HeaderText="MachineType" SortExpression="MachineType" /> <asp:BoundField DataField="Kernel" HeaderText="Kernel" SortExpression="Kernel" /> <asp:BoundField DataField="SerialNo" HeaderText="SerialNo" SortExpression="SerialNo" /> <asp:BoundField DataField="PrimaryIP" HeaderText="PrimaryIP" SortExpression="PrimaryIP" /> </Columns> <FooterStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" /> <PagerStyle BackColor="#2461BF" ForeColor="White" HorizontalAlign="Center" /> <SelectedRowStyle BackColor="#D1DDF1" Font-Bold="True" ForeColor="#333333" /> <HeaderStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" /> <EditRowStyle BackColor="#2461BF" HorizontalAlign="Center" VerticalAlign="Middle" Wrap="True" /> <AlternatingRowStyle BackColor="White" /> </asp:GridView> <asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:sitehealthConnectionString %>" SelectCommand="SELECT [ServerID], [HostName], [MachineType], [Kernel], [SerialNo], [PrimaryIP] FROM [T_Servers]" onselecting="SqlDataSource1_Selecting"> </asp:SqlDataSource> </p> <asp:TemplateField HeaderText="Action"> <ItemTemplate> <asp:Label ID="lblEdit" runat="server" Text='<%# "<a href=frmAgents.aspx?Cmd=EDIT&NavigateId=" + DataBinder.Eval(Container.DataItem, "Id")+ ">Edit</a>"+" | "+ "<a onclick="+ch+"return ConfirmChoice()"+ ch +" href=frmAgents.aspx?Cmd=DELETE&NavigateId=" + DataBinder.Eval(Container.DataItem, "Id")+ ">Delete</a>" %>'></asp:Label> </ItemTemplate> <ItemStyle HorizontalAlign="Center" /> <HeaderStyle HorizontalAlign="Center" /> </asp:TemplateField> <p> </p> <p> Site Health Service Status: <asp:Label ID="serviceStatusLabel" runat="server" Font-Bold="True" Text="Label" ToolTip="If the service isn't started this application wont work"></asp:Label> <asp:Button ID="StopService" runat="server" Text="Stop Service" onclick="StopService_Click1" /> <asp:Button ID="StartService" runat="server" Text="Start Service" onclick="StartService_Click1" /> </p> <p> </p> <p> Page Refresh Time <asp:DropDownList ID="RefreshTime" runat="server" AppendDataBoundItems="True" AutoPostBack="True" onselectedindexchanged="RefreshTime_SelectedIndexChanged" ToolTip="Sets the refresh time of the current page"> <asp:ListItem Value="10">10 Seconds</asp:ListItem> <asp:ListItem Value="30">30 Seconds</asp:ListItem> <asp:ListItem Value="60">60 Seconds</asp:ListItem> <asp:ListItem Value="300">5 Minutes</asp:ListItem> <asp:ListItem Value="600">10 Minutes</asp:ListItem> <asp:ListItem Value="3">3 seconds</asp:ListItem> <asp:ListItem Value="5">5 seconds</asp:ListItem> </asp:DropDownList> <asp:Label ID="fresh" runat="server" Text="Label"></asp:Label> </p> <p> </p> <p> <asp:SqlDataSource ID="SqlDataSource2" runat="server" ConnectionString="<%$ ConnectionStrings:sitehealthConnectionString %>" DatasourceMode="DataSet" onselecting="SqlDataSource2_Selecting" SelectCommand="SELECT COUNT(*) FROM T_Servers"></asp:SqlDataSource> </p> </asp:Content>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server"> <h1 style="text-align: center; color: #FFFFFF;"> <asp:Label ID="CompanyName" runat="server" style="font-size: x-large" Text="Label"></asp:Label> </h1> <p> You are currenlty monitoring <asp:Label ID="serverCount" runat="server" Text="servercount"></asp:Label> Solaris Servers:</p> <p> <asp:GridView ID="ListOfServers" runat="server" AllowPaging="True" AllowSorting="True" AutoGenerateColumns="False" BorderStyle="Solid" BorderWidth="2px" CaptionAlign="Bottom" CellPadding="4" DataKeyNames="ServerID" DataSourceID="SqlDataSource1" Font-Bold="True" Font-Names="Cordia New" Font-Size="Medium" ForeColor="#333333" HorizontalAlign="Center" ToolTip="This table contains the current list of monitored servers." Width="95%"> <RowStyle BackColor="#EFF3FB" /> <Columns> <asp:CommandField ShowSelectButton="True" /> <asp:BoundField DataField="ServerID" HeaderText="ServerID" InsertVisible="False" ReadOnly="True" SortExpression="ServerID" /> <asp:BoundField DataField="HostName" HeaderText="HostName" SortExpression="HostName" /> <asp:BoundField DataField="MachineType" HeaderText="MachineType" SortExpression="MachineType" /> <asp:BoundField DataField="Kernel" HeaderText="Kernel" SortExpression="Kernel" /> <asp:BoundField DataField="SerialNo" HeaderText="SerialNo" SortExpression="SerialNo" /> <asp:BoundField DataField="PrimaryIP" HeaderText="PrimaryIP" SortExpression="PrimaryIP" /> <asp:TemplateField HeaderText="Action"> <ItemTemplate> <asp:Label ID="lblEdit" runat="server" Text='<%# "<a href=frmAgents.aspx?Cmd=EDIT&NavigateId=" + DataBinder.Eval(Container.DataItem, "Id")+ ">Edit</a>"+" | "+ "<a onclick="+ch+"return ConfirmChoice()"+ ch +" href=frmAgents.aspx?Cmd=DELETE&NavigateId=" + DataBinder.Eval(Container.DataItem, "Id")+ ">Delete</a>" %>'></asp:Label> </ItemTemplate> <ItemStyle HorizontalAlign="Center" /> <HeaderStyle HorizontalAlign="Center" /> </asp:TemplateField> </Columns> <FooterStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" /> <PagerStyle BackColor="#2461BF" ForeColor="White" HorizontalAlign="Center" /> <SelectedRowStyle BackColor="#D1DDF1" Font-Bold="True" ForeColor="#333333" /> <HeaderStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" /> <EditRowStyle BackColor="#2461BF" HorizontalAlign="Center" VerticalAlign="Middle" Wrap="True" /> <AlternatingRowStyle BackColor="White" /> </asp:GridView> <asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:sitehealthConnectionString %>" SelectCommand="SELECT [ServerID], [HostName], [MachineType], [Kernel], [SerialNo], [PrimaryIP] FROM [T_Servers]" onselecting="SqlDataSource1_Selecting"> </asp:SqlDataSource> </p> <p> </p> <p> Site Health Service Status: <asp:Label ID="serviceStatusLabel" runat="server" Font-Bold="True" Text="Label" ToolTip="If the service isn't started this application wont work"></asp:Label> <asp:Button ID="StopService" runat="server" Text="Stop Service" onclick="StopService_Click1" /> <asp:Button ID="StartService" runat="server" Text="Start Service" onclick="StartService_Click1" /> </p> <p> </p> <p> Page Refresh Time <asp:DropDownList ID="RefreshTime" runat="server" AppendDataBoundItems="True" AutoPostBack="True" onselectedindexchanged="RefreshTime_SelectedIndexChanged" ToolTip="Sets the refresh time of the current page"> <asp:ListItem Value="10">10 Seconds</asp:ListItem> <asp:ListItem Value="30">30 Seconds</asp:ListItem> <asp:ListItem Value="60">60 Seconds</asp:ListItem> <asp:ListItem Value="300">5 Minutes</asp:ListItem> <asp:ListItem Value="600">10 Minutes</asp:ListItem> <asp:ListItem Value="3">3 seconds</asp:ListItem> <asp:ListItem Value="5">5 seconds</asp:ListItem> </asp:DropDownList> <asp:Label ID="fresh" runat="server" Text="Label"></asp:Label> </p> <p> </p> <p> <asp:SqlDataSource ID="SqlDataSource2" runat="server" ConnectionString="<%$ ConnectionStrings:sitehealthConnectionString %>" DatasourceMode="DataSet" onselecting="SqlDataSource2_Selecting" SelectCommand="SELECT COUNT(*) FROM T_Servers"></asp:SqlDataSource> </p> </asp:Content>
| DaniWeb Message | |
| Cancel Changes | |