FormView Question

FormView Question

Old forum URL: forums.lhotka.net/forums/t/6650.aspx


SouthSpawn posted on Monday, March 23, 2009

Ok, I am databinding to a FormView control no problem.
No matter which mode I am in, "Edit" or "Insert" mode.
 
When a broken business rule is triggered, on the post back I am losing all data.
 
Why is this happening?

Also, is there a way I could do a Ajax to update the objects data so I can avoid the postback issue?

If so, how do I get access to the "e.values("MyField")" in Ajax?

What are my options here?

Thanks,
Mark

SouthSpawn replied on Monday, March 23, 2009

Anyone?

SouthSpawn replied on Monday, March 23, 2009

Never mind, I figured it out.

rfcdejong replied on Monday, March 23, 2009

Nice that u figured it out.

Did u forget to use sessions or cookies?
I remember ajax's updatepanel to only update a small part of the website, works nice.

SouthSpawn replied on Monday, March 23, 2009

There is an "ModeChanging" event on the FormView control.
If the BO has an invalid business rule.
 
Just do a e.cancel = true in the event.
 
That should do the trick.

Copyright (c) Marimer LLC