hi,
I still get errors do I need something in the server side code?:
Compiler Error Message: CS0103: The name 'ch' does not exist in the current context
Source Error:
Line 39: <asp:TemplateField HeaderText="Action">
Line 40: <ItemTemplate>
Line 41: <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>
Line 42: </ItemTemplate>
Line 43: <ItemStyle HorizontalAlign="Center" />
Code is as follows:
<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>