Author: akaEdge | Posted on: 2/10/2008 3:39:54 PM | Views : 276

I have a very simple FormView on a page with a SqlDataSource. I don't have anything in the codebehind (all taken out trying to debug this problem) and I'm not using a Master Page.
The problem is that I need to run some logic on the OnLoad of a Textbox control (this would later be moved out into a UserControl in a seperate file) but I am finding that the Load event is getting fired twice on postbacks (ie when I update - selecting (or no postback) is fine).
I tracked this by adding lots of break points on events, and found that after the Page_PreRender event, the control is being loaded again - does anyone have any idea why this might be??
Here is the events in order, EditFV is my FormView and EditDS is my SqlDataSource, Description is the name of the Textbox control in the Edit Template of the FormView:
EditFV_Init
Page_Init
Page_Load
EditFV_Load
Description_Load
EditDS_Updated
Page_PreRender
EditDS_Selected
Desc ...

Go to the complete details ...