cause the page_unload event to fire twice. If I remove the
response.redirect, the problem goes away :). I've got a work around, but I'm
curious how one is supposed to programmatically navigate between web pages
without the page_unload event firing twice.
Thanks,
Larry Morris
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
'Put user code to initialize the page here
Stop
End Sub
Private Sub Page_Unload(ByVal sender As Object, ByVal e As System.EventArgs)
Handles MyBase.Unload
Stop
End Sub
Private Sub LinkButton1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles LinkButton1.Click
Response.Redirect("http://www.microsoft.com")
End Sub
End Class
--------------------------------------------------------
Sayfa ilk kez yüklendiğinde ,en son yapılacak olan HTML kodunun
browser a dönüşümünden hemen önce Page_Unload ilk kez çağırılır.
Daha
sonra link button Page_Unload u tekrar çağıracak olan ,Page Postback i
çağırır.Eğer Page_Unload ı bir kez çağırmak isterseniz Is post back i
filtreleyecek olan Try Catch Blogunuz kullanın" demiş HTH
As the page is loaded the first time, it will invoke Page_Unload the
first time finally but just before rendering the HTML content to the
browser,
first time finally but just before rendering the HTML content to the
browser,
Then the link button will invoke page postback, in which the
page_unload will be invoked again.
If just want to invoke once, try to use if(IsPostBack) to filter it.
HTH.
"Bu durumda neler olacağını biliyorum ",diyerek durumları sıralamış ve Page_Unload event inin Response.redirect ile ilgisini açıklamaya başlamış.
T.Z
T.Z
I know that; What happens in this case is:
Page_Load,
Page_Unload,
Page_Load,
LinkButton1_Click,
Page_Unload,
Page_Unload.
Notice the Page_Unload event fired twice. What is it about the
Response.Redirect causes two page_unload events?
Page_Load,
Page_Unload,
Page_Load,
LinkButton1_Click,
Page_Unload,
Page_Unload.
Notice the Page_Unload event fired twice. What is it about the
Response.Redirect causes two page_unload events?
every page request has a load and unload. a redirect in the response tells
the browser to request a new page. page unload has nothing to do with the
browser, its just the last step in the creating the html for the page, it
used to release objects you created during building the page.
the browser to request a new page. page unload has nothing to do with the
browser, its just the last step in the creating the html for the page, it
used to release objects you created during building the page.
Her sayfa isteği load ve unload
edilir.Cevaptaki(response) yönlendirme ,browser a yeni bir sayfa
isteğinin olduğunu iletir.Page_Unload ın browser ile ilgisi yoktur ,Bu
sayfa için HTML oluşturmanın son adımıdır ve server da sayfanın inşası
sırasında oluşturulmuş nesneleri serbest bırakmak için kullanılır "
diyerek konuya noktayı koymuş .Bence açıklayıcıydı umarım sizin için de
öyledir ve faydalı olmuştur.
-- bruce (sqlwork.com)
-- bruce (sqlwork.com)
No comments:
Post a Comment