I have placed a databound textbox within an UpdatePanel. The UpdatePanel is embedded in a formview.
When the formview is edited and saved, in the formview ItemUpdating event, the field bound to the textbox e.NewValues("FieldName") is nothing and a blank value is saved in the database. However, if I take the textbox out of the UpdatePanel, the field bound to the textbox e.NewValues("FieldName") maintains its value and updates the database correctly.
Is there a fix for this problem?
Here is my sample code:
<asp:ScriptManagerID="ScriptManager1"runat="server"></asp:ScriptManager><asp:FormViewID="formview1"runat="server"DataKeyNames="Num" DataSourceID="ODS"><EditItemTemplate><asp:ButtonID="btnSave"runat="server"Text="Save"SkinID="CommandButton"CausesValidation="True"CommandName="Update"/> <asp:ButtonID="btnCancel"runat="server"Text="Cancel"SkinID="CommandButton"CausesValidation="False"CommandName="Cancel"/>
<br/><br/><asp:UpdatePanelID="upTypeOrg"runat="server"UpdateMode="Conditional"><ContentTemplate>
<asp:TextBoxID="TextBox1"Runat="server"Text='<%# Bind("FieldName") %>'Rows="4"TextMode="MultiLine"width="200px"EnableViewState="True"/></ContentTemplate></asp:UpdatePanel></EditItemTemplate></asp:FormView><asp:ObjectDataSourceID="ODS"runat="server"TypeName="SampleBLL"SelectMethod="GetData"UpdateMethod="UpdateData"><SelectParameters>
<asp:QueryStringParameterName="Num"QueryStringField="Num"Type="String"DefaultValue=""/></SelectParameters><UpdateParameters>
<asp:ParameterName="Num"Type="String"/>
<asp:ParameterName="FieldName"Type="String"/></UpdateParameters></asp:ObjectDataSource>
Thank you.