Developer forum

Forum » Development » Page_Load executes twice!

Page_Load executes twice!


Reply

Hi


When a customer add a product to the basket, the Page_Load method in Default.aspx.cs is executed twice. The first time Page_Load is executed then when it gets to the Pageview.Load method it executes the Page_Load method again! The second time when it gets to the Pageview.Load method it continues to the Pageview.Output method as normal. But why is the Page_Load method executed twice when a product is added to the basket, and is it possible to avoid?


 


Regards


Lars Larsen, DIS


Replies

 
Reply
Report this case as a bug to DW support, please.
 
Nicolai Høeg Pedersen
Reply

Hi Lars


 


Its not a real bug - when you add something to the basket, you submit to Default.aspx and page_load is fired. Then the product is added to the basket somewhere in the pageview object, and when done, it redirects to the page you where coming from - this way it looks like a double page_load.


 


This is done to avoid F5 press repeats the add to basket call.

 

You must be logged in to post in the forum