Monday, September 29, 2008

FormView - FindControl causes DataBind when in EditMode!

I just had the misfortune of discovering a “feature” of the FormView: If you try to do a a FormView.FindControl while in EditMode, it causes a DataBind that very instant.  This was perplexing b/c right after I did the FindControl, I was trying to change the mode to Insert and couldn’t figure out why the ObjectDataSource was all-of-a-sudden firing a Select?  This happened after a small tweak to working code mind-you, so it’s one of those “oh-shoot, what just happened to completely break the form I’ve been working on for 5 days” moments!  I guess that’s what I get for going Codeless.

 

 

No comments: