Quantcast
Channel: ASP.NET AJAX + Ajax Control Toolkit (ACT)
Viewing all articles
Browse latest Browse all 5678

Error databinding textbox inside UpdatePanel and UpdatePanel is embedded in Formview

$
0
0

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"/>&nbsp;&nbsp;

<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.


Viewing all articles
Browse latest Browse all 5678

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>