22
Jan/09
0

asp.net formview problem updating data

Very strange behavior with formviews on asp.net.  For some reason, if I declare the SqlDataSource on the page source but then do the binding of the SqlDataSource to the formview in code behind, no error are shown but the data does NOT get updated on edit.

So instead of doing this in code behind

summary.DataSourceID = "summaryDS";
summary.DataBind();

I need to do this on the page

<asp :FormView ID="summary"
runat="server"
DataSourceID="summaryDS">

A previous problem I encountered with formview

29
Jul/08
0

.NET formview edit mode problem

I encountered problem with the formview not switching to edit mode using the standard commandname=”Edit” for a linkbutton.  It turns out the problem was with the way I bind the data source to the formview through code behind.  I changed that to defining the formview tag with the attribute of datasource while defining the data source on the page code and everything worked just fine.  Go figure.

Filed under: .net