When I run your code, the delete executes without the confirmation. When you say (in your code comment) to add to ClientClick, where and how is that set. I think you mean in the DetailsView asp code, but I do not see ClientClick as an option. I see "OnItemCommand"
or "OnItemDeleting". Would one of these be used? If so, what do I set it equal to? Or do I need to set it to the LinkButton ClientClick in asp? With the AutoGenerate option, the command rows or LinkButtons are not explicitly stated. The only asp reference
I see to the LinkBUttons are AutoGenerateDelete="True", etc.
mjta
Member
324 Points
684 Posts
Re: DetailsView confirm message
Apr 15, 2010 02:55 PM|LINK
When I run your code, the delete executes without the confirmation. When you say (in your code comment) to add to ClientClick, where and how is that set. I think you mean in the DetailsView asp code, but I do not see ClientClick as an option. I see "OnItemCommand" or "OnItemDeleting". Would one of these be used? If so, what do I set it equal to? Or do I need to set it to the LinkButton ClientClick in asp? With the AutoGenerate option, the command rows or LinkButtons are not explicitly stated. The only asp reference I see to the LinkBUttons are AutoGenerateDelete="True", etc.
Here is my code....hope it helps....
<asp:DetailsView ID="DetailsView1" runat="server" AutoGenerateDeleteButton="True" AutoGenerateEditButton="True" AutoGenerateInsertButton="True" AutoGenerateRows="False" BorderColor="#003366" BorderStyle="Solid" BorderWidth="1px" CellPadding="4" DataKeyNames="HosId" DataSourceID="SqlDataSource1" ForeColor="#333333" GridLines="None" Height="50px"> <FooterStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" /> <CommandRowStyle BackColor="#D1DDF1" Font-Bold="True" ForeColor="Blue" /> <RowStyle BackColor="#EFF3FB" BorderColor="#003366" BorderStyle="Solid" BorderWidth="1px" Width="100px" /> <FieldHeaderStyle BackColor="#DEE8F5" Font-Bold="True" Width="100px" Wrap="False" /> <PagerStyle BackColor="#2461BF" ForeColor="White" HorizontalAlign="left" /> <Fields> <asp:BoundField DataField="HosId" HeaderText="HosId" visible="false" SortExpression="HosId" /> <asp:BoundField DataField="HosNam" HeaderText="Name" SortExpression="HosNam" /> <asp:BoundField DataField="HosCit" HeaderText="City" SortExpression="HosCit" /> <asp:BoundField DataField="HosSta" HeaderText="State" SortExpression="HosSta" /> <asp:BoundField DataField="HosPhNum" HeaderText="Phone" SortExpression="HosPhNum" /> <asp:BoundField DataField="IPAddress" visible="false" HeaderText="IPAddress" SortExpression="IPAddress" /> <asp:BoundField DataField="Date" visible="false" HeaderText="Date" SortExpression="Date" /> <asp:BoundField DataField="UserID" visible="false" HeaderText="UserID" SortExpression="UserID" /> <asp:BoundField DataField="ExtIPAdd" visible="false" HeaderText="ExtIPAdd" SortExpression="ExtIPAdd" /> </Fields> <HeaderStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" /> <EditRowStyle BackColor="#2461BF" /> <AlternatingRowStyle BackColor="White" /> </asp:DetailsView>