如何将用户重定向到同一页面? [英] How to redirect user to same page?

查看:116
本文介绍了如何将用户重定向到同一页面?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

获取System.Threading.ThreadAbortException:线程正在中止.使用
将用户重定向到同一页面时发生异常 Response.Redirect("Employee.aspx?EmpId =" + empID")

步骤:
1)单击页面以添加员工
2)点击保存
3)保存记录后,我想让用户与页面的更新内容保持一致,为此,我正在使用

Getting System.Threading.ThreadAbortException: Thread was being aborted. Exception while Redirecting user to same page using
Response.Redirect("Employee.aspx?EmpId=" + empID")

Steps:
1) Click on page to Add Employee
2) Click on save
3) after saving the record I want to keep user to same with updated content of page, for this I am using

Response.Redirect("Employee.aspx?EmpId=" + empID")




预先感谢.




Thanks in advance.

推荐答案

Response.Redirect("Employee.aspx?EmpId=" + empID",false)


为什么要重定向到同一页面?在回发过程中,您拥有根据需要刷新页面所需的所有信息.
Why are you redirecting to the same page? You have all of the information necessary during the postback to refresh the page as desired.


您实际上不需要将用户重定向到同一页面,因为保存数据后,默认情况下您将位于同一页面上.如果要更新内容,则只需要再次绑定它即可.然后保存后,您需要编写
you dont really need to redirect user to same page because after saving data you will be on the same page by default. If you want to update the content then you just need to bind it again. For example if it is gridview then just after saving you need to write
GridView1.Databind()



希望这会有所帮助.



Hope this will help.


这篇关于如何将用户重定向到同一页面?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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