Ίσως επειδή έχω πιει λίγο παραπάνω, ίσως επειδή δεν έχω τίποτε τρελό σε σχέση με τα κομπιούτερς και τους αριθμούς να γράψω, αποφάσισα να το ρίξω λίγο στο Α.Μ.Α.Ν.
Ακολουθούν επιλογές..
Μακράν το καλύτερο, ΟΤΕ...
Louka!
A8hnaikes pinakides
gunaikes sto timoni
logikh..
Xasame ton Pappou
Sunday, January 14, 2007
Thursday, January 04, 2007
Response.Redirect and ThreadAbortException
Response.Redirect..
That's the method that made me anxious and nervous and pissed off..
When you have a web page(main.aspx) and you want to go to another(second.aspx), you most often use
Response.Redirect("second.aspx");
at the code of main.aspx.
Until one day your project doesn't work and you get a ThreadAbortException.
You cannot imagine the reason, unless you spend some time on the net(or read it here in advance;) ).
The problem is that Response.Redirect(url), calls the Response.End internally, which terminates the thread of the main page from the call stack. That results in this exception.
The best practice, is to use the Response.Redirect(url, false) instead of Response.Redirect(url). False, is a boolean that defines that the thread of the main page should continue to be executed and not terminated.
That's all.. Just one more parameter :)
more info here and here.
That's the method that made me anxious and nervous and pissed off..
When you have a web page(main.aspx) and you want to go to another(second.aspx), you most often use
Response.Redirect("second.aspx");
at the code of main.aspx.
Until one day your project doesn't work and you get a ThreadAbortException.
You cannot imagine the reason, unless you spend some time on the net(or read it here in advance;) ).
The problem is that Response.Redirect(url), calls the Response.End internally, which terminates the thread of the main page from the call stack. That results in this exception.
The best practice, is to use the Response.Redirect(url, false) instead of Response.Redirect(url). False, is a boolean that defines that the thread of the main page should continue to be executed and not terminated.
That's all.. Just one more parameter :)
more info here and here.
Subscribe to:
Posts (Atom)