刷新按钮单击事件发生后 [英] after refreshing button click event happening

查看:82
本文介绍了刷新按钮单击事件发生后的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,

插入数据后刷新网页时出现问题.

在单击提交"按钮后,我正在使用提交"按钮从某些Web控件中插入数据,但是如果按 Refresh(F5)按钮,则在插入数据后一次,将触发相同的提交"按钮并进行数据插入再次从相同的控件中进行操作.
所以我不希望这种情况在刷新后发生.

任何解决方案.. ??

Hi to all.,

I have problem with refreshing web page after inserting data.

I m inserting data from some web controls with submit button, after clicking Submit button data is inserting properly, but once after inserting the data if i pressed Refresh (F5) button the same Submit button triggering and data inserting from those same controls once again.
so i don''t want this happening after refresh.

any solution..??

推荐答案

将插入代码放入
Put insert code in
if(!Page.isPostBack)
{
   //insert code..
}


然后,您就去了!


And..there you go!


一种方法是在插入后重定向到同一页面.
One way is to redirect to same page after the insertion.


您必须先应用check方法,然后再插入值.
You have to apply check method before inserting the value.


这篇关于刷新按钮单击事件发生后的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆