各位防刷新,防二次提交有什么高招每没?

liu_ff123 2007-06-21 04:22:51
RT
...全文
290 18 打赏 收藏 转发到动态 举报
写回复
用AI写文章
18 条回复
切换为时间正序
请发表友善的回复…
发表回复
DavidNoWay 2007-06-21
  • 打赏
  • 举报
回复
路过
周力 2007-06-21
  • 打赏
  • 举报
回复
关注
volezbin 2007-06-21
  • 打赏
  • 举报
回复
如果是按钮触发事件,做一个Response.Write("<script language='javascript'>alert('操作成功');history.go(-1);</script>");
要不就Response.Redirect
这是最简单的两个方法.
如果你觉得不够好,建议采取楼上说的加验证码,或者做viewstate处理
csover8 2007-06-21
  • 打赏
  • 举报
回复
mark下
liu_ff123 2007-06-21
  • 打赏
  • 举报
回复
protected void Button1_Click(object sender, EventArgs e)
{
if ( ViewState["Submit"] != null )
{
LWord txtcontext = new LWord();
txtcontext.TextContent = this.TextArea1.Value;
(new Services()).send_word(txtcontext);
this.TextArea1.Value = "";
Binder();
ViewState["Submit"] = "1";
}
}


这样好像不行吧
wei123456 2007-06-21
  • 打赏
  • 举报
回复
protected void Button1_Click(object sender, EventArgs e)
{
if ( ViewState["Submit"] != null )
{
LWord txtcontext = new LWord();
txtcontext.TextContent = this.TextArea1.Value;
(new Services()).send_word(txtcontext);
this.TextArea1.Value = "";
Binder();
ViewState["Submit"] = "1";
}
}
lang11zi 2007-06-21
  • 打赏
  • 举报
回复
加个验证码
liu_ff123 2007-06-21
  • 打赏
  • 举报
回复
这样跳来跳去肯定很累吧!速度应该不快
cancersyf 2007-06-21
  • 打赏
  • 举报
回复
http://www.cnblogs.com/fengzhimei/archive/2004/08/03/29642.aspx
http://www.codeproject.com/aspnet/SyncControl.asp
truecoffeefox 2007-06-21
  • 打赏
  • 举报
回复
清空viewstate跳到另一个页面再转回去呗
volezbin 2007-06-21
  • 打赏
  • 举报
回复
完成操作后,加个Response.Redirect重新定向回本页
liu_ff123 2007-06-21
  • 打赏
  • 举报
回复
各位怎么实现
liu_ff123 2007-06-21
  • 打赏
  • 举报
回复

public partial class _Default : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{


}

private void Binder()
{
this.UltraWebGrid1.DataSourceID = "ObjectDataSource1";
this.UltraWebGrid1.DataBind();

}

protected void Button1_Click(object sender, EventArgs e)
{
LWord txtcontext = new LWord();
txtcontext.TextContent = this.TextArea1.Value;
(new Services()).send_word(txtcontext);
this.TextArea1.Value = "";
Binder();
}
}
wei123456 2007-06-21
  • 打赏
  • 举报
回复
ViewState 就是本页使用的
showrock 2007-06-21
  • 打赏
  • 举报
回复
按钮提交过后,visibile=false
liu_ff123 2007-06-21
  • 打赏
  • 举报
回复
不要通过页面跳转
wei123456 2007-06-21
  • 打赏
  • 举报
回复
使用ViewState 提交后如果ViewState为空将ViewState赋值,不为空则认为是二次提交
liu_ff123 2007-06-21
  • 打赏
  • 举报
回复
不要通过页面提交的方法,我的程序是本页面提交,本页显示的。

62,041

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术交流专区
javascript云原生 企业社区
社区管理员
  • ASP.NET
  • .Net开发者社区
  • R小R
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告

.NET 社区是一个围绕开源 .NET 的开放、热情、创新、包容的技术社区。社区致力于为广大 .NET 爱好者提供一个良好的知识共享、协同互助的 .NET 技术交流环境。我们尊重不同意见,支持健康理性的辩论和互动,反对歧视和攻击。

希望和大家一起共同营造一个活跃、友好的社区氛围。

试试用AI创作助手写篇文章吧