how should i do it?

Please support our ASP.NET advertiser: Intel Parallel Studio Home
Thread Solved

Join Date: Feb 2006
Posts: 399
Reputation: chris5126 is an unknown quantity at this point 
Solved Threads: 14
chris5126 chris5126 is offline Offline
Posting Whiz

how should i do it?

 
0
  #1
Apr 19th, 2009
Hi,

Im creating a website that will be used to monitor servers, the user can add and remove servers and the servers list will be constantly chaning.

I need to create a generic page to display the monitoring results that will adapt depending on which server the user selects. The graphs and results dispalyed will always be the same however the data will change depending on which server is selected. How would i go about doing this and is there any good examples online?

Would i need to create new pages as servers are loaded? or could i use a master page that changes depending on server?
If my post helped add to my rep!
Reply With Quote Quick reply to this message  
Join Date: Apr 2009
Posts: 217
Reputation: mail2saion is an unknown quantity at this point 
Solved Threads: 31
mail2saion's Avatar
mail2saion mail2saion is offline Offline
Posting Whiz in Training

Re: how should i do it?

 
0
  #2
Apr 19th, 2009
FOR REFRESH YOU CAN USE AJAX. TO LEARN MORE ON THIS GO TO asp.net learn section. Server means what? Just input & then save??? Need to know details. For graph you can use fusion chart which is free.
MARK AS SOLVED if its help you.

REGARDS
MCTS - Shawpnendu bikash maloroy
http://shawpnendu.blogspot.com
Reply With Quote Quick reply to this message  
Join Date: Feb 2006
Posts: 399
Reputation: chris5126 is an unknown quantity at this point 
Solved Threads: 14
chris5126 chris5126 is offline Offline
Posting Whiz

Re: how should i do it?

 
0
  #3
Apr 19th, 2009
hi,

I mean like a windows server or unix server basically monitoring computers and I would like to have one template that could be used for every server, the data about each server is stored in a sql database so when the user selects say server1 it will load the template with all the information about server1, but if they chose server2 then it will load all the information about server2. I need to know whether this should be done with a master page i.e create the template then each time a new server is added it will create a page based on that template or is there another way which would be better?
If my post helped add to my rep!
Reply With Quote Quick reply to this message  
Join Date: Apr 2009
Posts: 217
Reputation: mail2saion is an unknown quantity at this point 
Solved Threads: 31
mail2saion's Avatar
mail2saion mail2saion is offline Offline
Posting Whiz in Training

Re: how should i do it?

 
0
  #4
Apr 19th, 2009
Basically MASTER page is used for a common header, footer or left menu purpose. According to your why you think complex. Its easy i think. You can design an aspx page which will be the master page. Then design child page.

In master page you will show the list of available/active servers in a GridView.
When user click on a row then redirect to the child page by the selected server id. In child page select child details by a select statement where serverid=querystring value.

Let me know if you cant understand.
MARK AS SOLVED if its help you.

REGARDS
MCTS - Shawpnendu bikash maloroy
http://shawpnendu.blogspot.com
Reply With Quote Quick reply to this message  
Join Date: Feb 2006
Posts: 399
Reputation: chris5126 is an unknown quantity at this point 
Solved Threads: 14
chris5126 chris5126 is offline Offline
Posting Whiz

Re: how should i do it?

 
0
  #5
Apr 19th, 2009
hi,

That is exactly how i have done it so far. Have a sql query on my homepage which returns a list of the servers that the program is monitoring. I have selected the option make them selectable and would like it to take the user to a page depending on which is selected i have done it using gridview code below, however when they are selected nothing happens do i need to put something in the code file to make this happen? are there any good examples
  1. <asp:GridView ID="ListOfServers" runat="server" AllowPaging="True"
  2. AllowSorting="True" AutoGenerateColumns="False" BorderStyle="Solid"
  3. BorderWidth="2px" CaptionAlign="Bottom" CellPadding="4" DataKeyNames="ServerID"
  4. DataSourceID="SqlDataSource1" Font-Bold="True" Font-Names="Cordia New"
  5. Font-Size="Medium" ForeColor="#333333" HorizontalAlign="Center"
  6. ToolTip="This table contains the current list of monitored servers."
  7. Width="95%">
  8. <RowStyle BackColor="#EFF3FB" />
  9. <Columns>
  10. <asp:CommandField ShowSelectButton="True" />
  11. <asp:BoundField DataField="ServerID" HeaderText="ServerID"
  12. InsertVisible="False" ReadOnly="True" SortExpression="ServerID" />
  13. <asp:BoundField DataField="HostName" HeaderText="HostName"
  14. SortExpression="HostName" />
  15. <asp:BoundField DataField="MachineType" HeaderText="MachineType"
  16. SortExpression="MachineType" />
  17. <asp:BoundField DataField="Kernel" HeaderText="Kernel"
  18. SortExpression="Kernel" />
  19. <asp:BoundField DataField="SerialNo" HeaderText="SerialNo"
  20. SortExpression="SerialNo" />
  21. <asp:BoundField DataField="PrimaryIP" HeaderText="PrimaryIP"
  22. SortExpression="PrimaryIP" />
  23. </Columns>
  24. <FooterStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
  25. <PagerStyle BackColor="#2461BF" ForeColor="White" HorizontalAlign="Center" />
  26. <SelectedRowStyle BackColor="#D1DDF1" Font-Bold="True" ForeColor="#333333" />
  27. <HeaderStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
  28. <EditRowStyle BackColor="#2461BF" HorizontalAlign="Center"
  29. VerticalAlign="Middle" Wrap="True" />
  30. <AlternatingRowStyle BackColor="White" />
  31. </asp:GridView>
If my post helped add to my rep!
Reply With Quote Quick reply to this message  
Join Date: Apr 2009
Posts: 217
Reputation: mail2saion is an unknown quantity at this point 
Solved Threads: 31
mail2saion's Avatar
mail2saion mail2saion is offline Offline
Posting Whiz in Training

Re: how should i do it?

 
0
  #6
Apr 20th, 2009
YOU CAN ACHIEVE THIS IN THE FOLLOWING WAY:
  1. <asp:TemplateField HeaderText="Action">
  2. <ItemTemplate>
  3. <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>
  4. </ItemTemplate>
  5. <ItemStyle HorizontalAlign="Center" />
  6. <HeaderStyle HorizontalAlign="Center" />
  7. </asp:TemplateField>
MARK AS SOLVED if its help you.

REGARDS
MCTS - Shawpnendu bikash maloroy
http://shawpnendu.blogspot.com
Reply With Quote Quick reply to this message  
Join Date: Feb 2006
Posts: 399
Reputation: chris5126 is an unknown quantity at this point 
Solved Threads: 14
chris5126 chris5126 is offline Offline
Posting Whiz

Re: how should i do it?

 
0
  #7
Apr 20th, 2009
hi,

Where would I put this code. I put it directly after the code I showed you before but it gave errors, do I need to add new controls to the website first? Errors are as follows:

  1. 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
Complete code for home page
  1. <%@ Page Language="C#" MasterPageFile="~/Master1.master" AutoEventWireup="true" CodeFile="Home.aspx.cs" Inherits="Home" Title="Site Health Home Page" %>
  2. <%@ MasterType virtualpath="~/Master1.master" %>
  3. <asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
  4. <h1 style="text-align: center; color: #FFFFFF;">
  5. <asp:Label ID="CompanyName" runat="server" style="font-size: x-large"
  6. Text="Label"></asp:Label>
  7. </h1>
  8. <p>
  9. You are currenlty
  10. monitoring
  11. <asp:Label ID="serverCount" runat="server" Text="servercount"></asp:Label>
  12. Solaris Servers:</p>
  13. <p>
  14. <asp:GridView ID="ListOfServers" runat="server" AllowPaging="True"
  15. AllowSorting="True" AutoGenerateColumns="False" BorderStyle="Solid"
  16. BorderWidth="2px" CaptionAlign="Bottom" CellPadding="4" DataKeyNames="ServerID"
  17. DataSourceID="SqlDataSource1" Font-Bold="True" Font-Names="Cordia New"
  18. Font-Size="Medium" ForeColor="#333333" HorizontalAlign="Center"
  19. ToolTip="This table contains the current list of monitored servers."
  20. Width="95%">
  21. <RowStyle BackColor="#EFF3FB" />
  22. <Columns>
  23. <asp:CommandField ShowSelectButton="True" />
  24. <asp:BoundField DataField="ServerID" HeaderText="ServerID"
  25. InsertVisible="False" ReadOnly="True" SortExpression="ServerID" />
  26. <asp:BoundField DataField="HostName" HeaderText="HostName"
  27. SortExpression="HostName" />
  28. <asp:BoundField DataField="MachineType" HeaderText="MachineType"
  29. SortExpression="MachineType" />
  30. <asp:BoundField DataField="Kernel" HeaderText="Kernel"
  31. SortExpression="Kernel" />
  32. <asp:BoundField DataField="SerialNo" HeaderText="SerialNo"
  33. SortExpression="SerialNo" />
  34. <asp:BoundField DataField="PrimaryIP" HeaderText="PrimaryIP"
  35. SortExpression="PrimaryIP" />
  36. </Columns>
  37. <FooterStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
  38. <PagerStyle BackColor="#2461BF" ForeColor="White" HorizontalAlign="Center" />
  39. <SelectedRowStyle BackColor="#D1DDF1" Font-Bold="True" ForeColor="#333333" />
  40. <HeaderStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
  41. <EditRowStyle BackColor="#2461BF" HorizontalAlign="Center"
  42. VerticalAlign="Middle" Wrap="True" />
  43. <AlternatingRowStyle BackColor="White" />
  44. </asp:GridView>
  45. <asp:SqlDataSource ID="SqlDataSource1" runat="server"
  46. ConnectionString="<%$ ConnectionStrings:sitehealthConnectionString %>"
  47.  
  48. SelectCommand="SELECT [ServerID], [HostName], [MachineType], [Kernel], [SerialNo], [PrimaryIP] FROM [T_Servers]"
  49. onselecting="SqlDataSource1_Selecting">
  50. </asp:SqlDataSource>
  51. </p>
  52. <asp:TemplateField HeaderText="Action">
  53. <ItemTemplate>
  54. <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>
  55. </ItemTemplate>
  56. <ItemStyle HorizontalAlign="Center" />
  57. <HeaderStyle HorizontalAlign="Center" />
  58. </asp:TemplateField>
  59. <p>
  60. &nbsp;</p>
  61. <p>
  62. Site Health Service Status:
  63. <asp:Label ID="serviceStatusLabel" runat="server" Font-Bold="True" Text="Label"
  64. ToolTip="If the service isn't started this application wont work"></asp:Label>
  65. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
  66. <asp:Button ID="StopService" runat="server" Text="Stop Service"
  67. onclick="StopService_Click1" />
  68. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
  69. <asp:Button ID="StartService" runat="server" Text="Start Service"
  70. onclick="StartService_Click1" />
  71. </p>
  72. <p>
  73. &nbsp;</p>
  74. <p>
  75. Page Refresh Time
  76. <asp:DropDownList ID="RefreshTime" runat="server" AppendDataBoundItems="True"
  77. AutoPostBack="True" onselectedindexchanged="RefreshTime_SelectedIndexChanged"
  78. ToolTip="Sets the refresh time of the current page">
  79. <asp:ListItem Value="10">10 Seconds</asp:ListItem>
  80. <asp:ListItem Value="30">30 Seconds</asp:ListItem>
  81. <asp:ListItem Value="60">60 Seconds</asp:ListItem>
  82. <asp:ListItem Value="300">5 Minutes</asp:ListItem>
  83. <asp:ListItem Value="600">10 Minutes</asp:ListItem>
  84. <asp:ListItem Value="3">3 seconds</asp:ListItem>
  85. <asp:ListItem Value="5">5 seconds</asp:ListItem>
  86. </asp:DropDownList>
  87. &nbsp;
  88. <asp:Label ID="fresh" runat="server" Text="Label"></asp:Label>
  89. </p>
  90. <p>
  91. &nbsp;</p>
  92. <p>
  93. <asp:SqlDataSource ID="SqlDataSource2" runat="server"
  94. ConnectionString="<%$ ConnectionStrings:sitehealthConnectionString %>"
  95. DatasourceMode="DataSet"
  96. onselecting="SqlDataSource2_Selecting"
  97. SelectCommand="SELECT COUNT(*) FROM T_Servers"></asp:SqlDataSource>
  98. </p>
  99. </asp:Content>
If my post helped add to my rep!
Reply With Quote Quick reply to this message  
Join Date: Apr 2007
Posts: 370
Reputation: greeny_1984 is an unknown quantity at this point 
Solved Threads: 29
greeny_1984's Avatar
greeny_1984 greeny_1984 is offline Offline
Posting Whiz

Re: how should i do it?

 
0
  #8
Apr 20th, 2009
Hi,

The previous poster suggested to place the code he gave in to gridview not outside it.
If u r query is achieved,mark the thread as solved

Live and Let Live
Reply With Quote Quick reply to this message  
Join Date: Feb 2006
Posts: 399
Reputation: chris5126 is an unknown quantity at this point 
Solved Threads: 14
chris5126 chris5126 is offline Offline
Posting Whiz

Re: how should i do it?

 
0
  #9
Apr 21st, 2009
hi im very new to all this any chance you could post the code back with where it should be, i have tried putting it into grid view but still get errors!
If my post helped add to my rep!
Reply With Quote Quick reply to this message  
Join Date: Apr 2007
Posts: 370
Reputation: greeny_1984 is an unknown quantity at this point 
Solved Threads: 29
greeny_1984's Avatar
greeny_1984 greeny_1984 is offline Offline
Posting Whiz

Re: how should i do it?

 
0
  #10
Apr 22nd, 2009
hi,

check this

  1. <asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
  2. <h1 style="text-align: center; color: #FFFFFF;">
  3. <asp:Label ID="CompanyName" runat="server" style="font-size: x-large"
  4. Text="Label"></asp:Label>
  5. </h1>
  6. <p>
  7. You are currenlty
  8. monitoring
  9. <asp:Label ID="serverCount" runat="server" Text="servercount"></asp:Label>
  10. Solaris Servers:</p>
  11. <p>
  12. <asp:GridView ID="ListOfServers" runat="server" AllowPaging="True"
  13. AllowSorting="True" AutoGenerateColumns="False" BorderStyle="Solid"
  14. BorderWidth="2px" CaptionAlign="Bottom" CellPadding="4" DataKeyNames="ServerID"
  15. DataSourceID="SqlDataSource1" Font-Bold="True" Font-Names="Cordia New"
  16. Font-Size="Medium" ForeColor="#333333" HorizontalAlign="Center"
  17. ToolTip="This table contains the current list of monitored servers."
  18. Width="95%">
  19. <RowStyle BackColor="#EFF3FB" />
  20. <Columns>
  21. <asp:CommandField ShowSelectButton="True" />
  22. <asp:BoundField DataField="ServerID" HeaderText="ServerID"
  23. InsertVisible="False" ReadOnly="True" SortExpression="ServerID" />
  24. <asp:BoundField DataField="HostName" HeaderText="HostName"
  25. SortExpression="HostName" />
  26. <asp:BoundField DataField="MachineType" HeaderText="MachineType"
  27. SortExpression="MachineType" />
  28. <asp:BoundField DataField="Kernel" HeaderText="Kernel"
  29. SortExpression="Kernel" />
  30. <asp:BoundField DataField="SerialNo" HeaderText="SerialNo"
  31. SortExpression="SerialNo" />
  32. <asp:BoundField DataField="PrimaryIP" HeaderText="PrimaryIP"
  33. SortExpression="PrimaryIP" />
  34. <asp:TemplateField HeaderText="Action">
  35. <ItemTemplate>
  36. <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>
  37. </ItemTemplate>
  38. <ItemStyle HorizontalAlign="Center" />
  39. <HeaderStyle HorizontalAlign="Center" />
  40. </asp:TemplateField>
  41. </Columns>
  42. <FooterStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
  43. <PagerStyle BackColor="#2461BF" ForeColor="White" HorizontalAlign="Center" />
  44. <SelectedRowStyle BackColor="#D1DDF1" Font-Bold="True" ForeColor="#333333" />
  45. <HeaderStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
  46. <EditRowStyle BackColor="#2461BF" HorizontalAlign="Center"
  47. VerticalAlign="Middle" Wrap="True" />
  48. <AlternatingRowStyle BackColor="White" />
  49. </asp:GridView>
  50. <asp:SqlDataSource ID="SqlDataSource1" runat="server"
  51. ConnectionString="<%$ ConnectionStrings:sitehealthConnectionString %>"
  52.  
  53. SelectCommand="SELECT [ServerID], [HostName], [MachineType], [Kernel], [SerialNo], [PrimaryIP] FROM [T_Servers]"
  54. onselecting="SqlDataSource1_Selecting">
  55. </asp:SqlDataSource>
  56. </p>
  57.  
  58. <p>
  59. &nbsp;</p>
  60. <p>
  61. Site Health Service Status:
  62. <asp:Label ID="serviceStatusLabel" runat="server" Font-Bold="True" Text="Label"
  63. ToolTip="If the service isn't started this application wont work"></asp:Label>
  64. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
  65. <asp:Button ID="StopService" runat="server" Text="Stop Service"
  66. onclick="StopService_Click1" />
  67. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
  68. <asp:Button ID="StartService" runat="server" Text="Start Service"
  69. onclick="StartService_Click1" />
  70. </p>
  71. <p>
  72. &nbsp;</p>
  73. <p>
  74. Page Refresh Time
  75. <asp:DropDownList ID="RefreshTime" runat="server" AppendDataBoundItems="True"
  76. AutoPostBack="True" onselectedindexchanged="RefreshTime_SelectedIndexChanged"
  77. ToolTip="Sets the refresh time of the current page">
  78. <asp:ListItem Value="10">10 Seconds</asp:ListItem>
  79. <asp:ListItem Value="30">30 Seconds</asp:ListItem>
  80. <asp:ListItem Value="60">60 Seconds</asp:ListItem>
  81. <asp:ListItem Value="300">5 Minutes</asp:ListItem>
  82. <asp:ListItem Value="600">10 Minutes</asp:ListItem>
  83. <asp:ListItem Value="3">3 seconds</asp:ListItem>
  84. <asp:ListItem Value="5">5 seconds</asp:ListItem>
  85. </asp:DropDownList>
  86. &nbsp;
  87. <asp:Label ID="fresh" runat="server" Text="Label"></asp:Label>
  88. </p>
  89. <p>
  90. &nbsp;</p>
  91. <p>
  92. <asp:SqlDataSource ID="SqlDataSource2" runat="server"
  93. ConnectionString="<%$ ConnectionStrings:sitehealthConnectionString %>"
  94. DatasourceMode="DataSet"
  95. onselecting="SqlDataSource2_Selecting"
  96. SelectCommand="SELECT COUNT(*) FROM T_Servers"></asp:SqlDataSource>
  97. </p>
  98. </asp:Content>
If u r query is achieved,mark the thread as solved

Live and Let Live
Reply With Quote Quick reply to this message  
Reply

This thread has been marked solved.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC