gridview删除 Web程序上怎么能用MessageBox呢?简直荒唐! 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 学web开发先搞清什么是服务器端,什么是客户端;什么是http协议。 web里面使用的是alert,confirm等方法 你应该在绑定的时候加比如OnClientClick="return confirm('真的要删除?')" <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" onrowcommand="GridView1_RowCommand" CellPadding="4" ForeColor="#333333" GridLines="None" Font-Size="12px" AllowPaging="True" PageSize="6" onpageindexchanging="GridView1_PageIndexChanging"> <FooterStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" /> <RowStyle BackColor="#EFF3FB" /> <Columns> <asp:BoundField DataField="rid" HeaderText="rid"> <ControlStyle CssClass="hidden" /> <FooterStyle CssClass="hidden" /> <HeaderStyle CssClass="hidden" /> <ItemStyle CssClass="hidden" /> </asp:BoundField> <asp:TemplateField HeaderText="招聘主题"> <ItemTemplate> <a target="_blank" href="../jobs/showjobs.aspx?rid=<%# Eval("rid") %>"><%# Eval("title") %></a> </ItemTemplate> </asp:TemplateField> <asp:BoundField DataField="job" HeaderText="职位名称" /> <asp:BoundField DataField="city" HeaderText="工作地点" /> <asp:BoundField DataField="number" HeaderText="招聘人数" /> <asp:BoundField DataField="pay" HeaderText="薪资水平" > <HeaderStyle Width="80px" /> </asp:BoundField> <asp:TemplateField HeaderText="应聘人数"> <ItemTemplate> <a href="toemploy.aspx?rid=<%# Eval("rid") %>"><%# Eval("applynum") %></a> </ItemTemplate> </asp:TemplateField> <asp:TemplateField HeaderText="添加时间"> <ItemTemplate> <%#Common.TimeChange.ToSystemTime(Eval("addtime").ToString())%> </ItemTemplate> </asp:TemplateField> <asp:TemplateField HeaderText="更新时间"> <ItemTemplate> <%#Common.TimeChange.ToSystemTime(Eval("updatetime").ToString())%> </ItemTemplate> </asp:TemplateField> <asp:ButtonField CommandName="renew" Text="更新" /> <asp:ButtonField CommandName="amend" Text="修改" /> <asp:ButtonField CommandName="del" Text="删除" /> </Columns> <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" /> <AlternatingRowStyle BackColor="White" /> </asp:GridView> protected void GridView1_RowCommand(object sender, GridViewCommandEventArgs e) { if (e.CommandName.Equals("amend")) { Response.Redirect("updaterecruit.aspx?rid=" + GridView1.Rows[Convert.ToInt32(e.CommandArgument)].Cells[0].Text); } else if (e.CommandName.Equals("del")) { if (Wpk.updateRecruit(GridView1.Rows[Convert.ToInt32(e.CommandArgument)].Cells[0].Text) > 0) { bind(); } } else if (e.CommandName.Equals("renew")) { if (Wpk.updateRecruit(GridView1.Rows[Convert.ToInt32(e.CommandArgument)].Cells[0].Text,"0") > 0) { bind(); } } else { } 参见http://dotnet.aspx.cc/file/Add-confirm-dialog-with-ButtonField-Column-of-GridView.aspx MessageBox.Show这个真不可以.... 你这样试试MessageBox("xxxxx");................... ClientScript.RegisterStartupScript(this.GetType(), "message", " <script language='javascript' >if(Confirm('确认码?'))document.getElementById('"+Hf.ClientID+"').value='1'; else document.getElementById('"+Hf.ClientID+"').value='0'; </script>"); if(Hf.Value.Equals("1")) { } 图片处理! !!!水晶报表VS2010下 找不到程序集的问题 C#Winform 主从窗体 继承变量问题 GRIDVIEW中链接如何传动态值 C#操作MYSQL数据库错误信息 求救~~~~~~~~~~~ web.config 配置 页面信息显示与不显示 dataGrid 数据显示问题! remoting sql问题 服务端和客户端之间的转发器 Gridview如何显示同时添加的多行数据
比如OnClientClick="return confirm('真的要删除?')"
AutoGenerateColumns="False" onrowcommand="GridView1_RowCommand"
CellPadding="4" ForeColor="#333333" GridLines="None" Font-Size="12px"
AllowPaging="True" PageSize="6"
onpageindexchanging="GridView1_PageIndexChanging">
<FooterStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
<RowStyle BackColor="#EFF3FB" />
<Columns>
<asp:BoundField DataField="rid" HeaderText="rid">
<ControlStyle CssClass="hidden" />
<FooterStyle CssClass="hidden" />
<HeaderStyle CssClass="hidden" />
<ItemStyle CssClass="hidden" />
</asp:BoundField>
<asp:TemplateField HeaderText="招聘主题">
<ItemTemplate>
<a target="_blank" href="../jobs/showjobs.aspx?rid=<%# Eval("rid") %>"><%# Eval("title") %></a>
</ItemTemplate>
</asp:TemplateField>
<asp:BoundField DataField="job" HeaderText="职位名称" />
<asp:BoundField DataField="city" HeaderText="工作地点" />
<asp:BoundField DataField="number" HeaderText="招聘人数" />
<asp:BoundField DataField="pay" HeaderText="薪资水平" >
<HeaderStyle Width="80px" />
</asp:BoundField>
<asp:TemplateField HeaderText="应聘人数">
<ItemTemplate>
<a href="toemploy.aspx?rid=<%# Eval("rid") %>"><%# Eval("applynum") %></a>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="添加时间">
<ItemTemplate>
<%#Common.TimeChange.ToSystemTime(Eval("addtime").ToString())%>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="更新时间">
<ItemTemplate>
<%#Common.TimeChange.ToSystemTime(Eval("updatetime").ToString())%>
</ItemTemplate>
</asp:TemplateField>
<asp:ButtonField CommandName="renew" Text="更新" />
<asp:ButtonField CommandName="amend" Text="修改" />
<asp:ButtonField CommandName="del" Text="删除" />
</Columns>
<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" />
<AlternatingRowStyle BackColor="White" />
</asp:GridView>
protected void GridView1_RowCommand(object sender, GridViewCommandEventArgs e)
{
if (e.CommandName.Equals("amend"))
{
Response.Redirect("updaterecruit.aspx?rid=" + GridView1.Rows[Convert.ToInt32(e.CommandArgument)].Cells[0].Text);
}
else if (e.CommandName.Equals("del"))
{
if (Wpk.updateRecruit(GridView1.Rows[Convert.ToInt32(e.CommandArgument)].Cells[0].Text) > 0)
{
bind();
}
}
else if (e.CommandName.Equals("renew"))
{
if (Wpk.updateRecruit(GridView1.Rows[Convert.ToInt32(e.CommandArgument)].Cells[0].Text,"0") > 0)
{
bind();
}
}
else { }
http://dotnet.aspx.cc/file/Add-confirm-dialog-with-ButtonField-Column-of-GridView.aspx
这个真不可以....
你这样试试
MessageBox("xxxxx");
...................
{ }