Click here to Skip to main content
15,889,116 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
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
VB
Response.Redirect("Employee.aspx?EmpId=" + empID")



Thanks in advance.
Posted

VB
Response.Redirect("Employee.aspx?EmpId=" + empID",false)
 
Share this answer
 
Why are you redirecting to the same page? You have all of the information necessary during the postback to refresh the page as desired.
 
Share this answer
 
Comments
Rachana Patel 22-Mar-12 9:42am    
I want to update some content of page, I am using popup window.
[no name] 22-Mar-12 9:52am    
Use JavaScript to refresh the parent page when the popup is closed.

parent.location.href = parent.location.href + 'query string'
Rachana Patel 22-Mar-12 10:16am    
I did the same thing using
function refreshcurrentPage(redirectingPage) {
var page = redirectingPage
window.location.href = page;
}
But this is refreshing my page 2 times.
[no name] 22-Mar-12 10:24am    
window refers to the window the script is being run in, the popup in this case. You want the parent of that window, the page that was used to open the popup from.

Where are you calling this from?
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
VB
GridView1.Databind()


Hope this will help.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900