我在GridView数据列表页面执行了删除操作,然后重新绑定数据。想在删除成功后alert一个删除成功信息:执行删除
Response.Write("<script>alert('删除成功!)'</script>");
重新绑定为什么alert以后页面的GridView的显示样式(字体、交错项的颜色)就不起作用呢?如果不加那句alert倒是正常的!这是为什么啊?
Response.Write("<script>alert('删除成功!)'</script>");
重新绑定为什么alert以后页面的GridView的显示样式(字体、交错项的颜色)就不起作用呢?如果不加那句alert倒是正常的!这是为什么啊?
解决方案 »
- FormView的EditItemTemplate更新取消按纽问题?
- 请大侠帮忙,父页面a.aspx打开子页面b.aspx ,子页面传值给父页面的textbox框。
- jsp 調用 asp.net 的webservice 時,總是報String reference not set to an instance of a String. Parameter name: s 錯誤??
- showmodaldialog回穿值问题
- 怎么在xml根据Request["id"]来select xml数据?
- ■■■■■大家有没有觉得ASP.net写网站所花的时间好像比asp要多??
- 请问如何在js里执行c#函数呀~~ 并且还想传递参数给c#函数~~~
- 求一套asp.net c#web下载系统
- .net不管怎么扩大超时配置,到一个小时准点报错【12002】
- 关于2003的问题
- 请教一下,这个GridView怎么点了分页后,格式会变化
- 请教GridView的取值问题~~
<asp:GridView ID="pj_GridView" runat="server" style="width: 100%; border-top-style: none; border-right-style: none; border-left-style: none; border-bottom-style: none;" AutoGenerateColumns="False" OnRowDataBound="pj_GridView_RowDataBound" OnRowDeleting="pj_GridView_RowDeleting" OnRowUpdated="pj_GridView_RowUpdated" DataKeyNames="pjid">
<Columns>
<asp:TemplateField>
<EditItemTemplate>
<asp:CheckBox ID="CheckBox1" runat="server" />
</EditItemTemplate>
<ItemTemplate>
<asp:CheckBox ID="CheckBox1" runat="server" />
</ItemTemplate>
<ControlStyle Width="20px" />
<ItemStyle Width="20px" CssClass="mlth1" />
<HeaderStyle Height="20px" CssClass="mlth" />
</asp:TemplateField>
<asp:BoundField DataField="pjbrand" HeaderText="品牌" >
<ItemStyle Width="80px" CssClass="mlth1" />
<HeaderStyle CssClass="mlth" />
</asp:BoundField>
<asp:BoundField DataField="pjname" HeaderText="名称" >
<ItemStyle Width="150px" CssClass="mlth1" />
<HeaderStyle CssClass="mlth" />
</asp:BoundField>
<asp:BoundField DataField="pjdetail" HeaderText="说明" >
<HeaderStyle CssClass="mlth" />
<ItemStyle CssClass="mlth1" />
</asp:BoundField>
<asp:BoundField DataField="pjprice" HeaderText="价格" >
<ItemStyle Width="50px" CssClass="mlth1" />
<HeaderStyle CssClass="mlth" />
</asp:BoundField>
<asp:TemplateField HeaderText="操作">
<ItemStyle CssClass="mlth1" Width="80px" />
<HeaderStyle CssClass="mlth" />
<ItemTemplate>
<asp:LinkButton ID="lbtn_update" runat="server" CommandName="update">修改</asp:LinkButton>
<asp:LinkButton ID="lbtn_delete" runat="server" CommandName="delete">删除</asp:LinkButton>
</ItemTemplate>
</asp:TemplateField>
</Columns>
<RowStyle Height="20px" BackColor="#F6F6F6" />
</asp:GridView>
((Page)HttpContext.Current.Handler).RegisterStartupScript("", "<script>alert(\"" + "删除成功" + "\");</script>");
PS:你写的那个本身就有语法错误
解决办法就是控制你的脚本输出的位置,而不是简单的用一个Response.Write就行了。
this.RegisterStartupScript("alert", "<script language=javascript>window.alert('删除成功!');</script>");
现:Response.Write("<script>alert('删除成功!')</script>");楼主看清了没?
你的Javascript语法写错了。
楼上的都是笨蛋么?
看来只能支持criedshy(哭泣的天空)的答案,虽然还是提示语法过……晚上揭贴