This is a migrated thread and some comments may be shown as answers.

Update Data with FormView and LinqData

1 Answer 119 Views
Editor
This is a migrated thread and some comments may be shown as answers.
Bruno
Top achievements
Rank 1
Bruno asked on 02 Mar 2009, 06:13 AM
I try to update data in a FormView, thats connected to a LinqDataSource. If I click on the Submit button, the page reloades, but the Data isen't updating. I cant find anything wrong with the code. Any help would be appreciated.

Bruno

Here the code:
        <asp:Panel ID="ContentHeaderPanel" runat="server" CssClass="Boxheader"
            <asp:DropDownList ID="ContentDropDownList" runat="server"  
                DataSourceID="ContentLinqDataSource" DataTextField="Content_Name"  
                DataValueField="Content_ID" AutoPostBack="True"
            </asp:DropDownList> 
            <asp:LinqDataSource ID="ContentLinqDataSource" runat="server"  
                ContextTypeName="gourmetnavigatorDataContext" OrderBy="Content_Name"  
                TableName="Content"
            </asp:LinqDataSource>
        </asp:Panel> 
 
        <asp:Panel ID="ContentPanel" runat="server" CssClass="Boxcontent"
            <asp:FormView ID="ContentFormView" runat="server" DefaultMode="Edit"  
                DataSourceID="ContentdetailLinqDataSource" DataKeyNames="Contentdetail_ID"
                <EditItemTemplate> 
                    <telerik:RadEditor ID="Contentdetail_Text" runat="server" Language="de-DE" 
                        Skin="Telerik" Content='<%# DataBinder.Eval(Container.DataItem, "Contentdetail_Text") %>'
                        <Tools> 
                            <telerik:EditorToolGroup> 
                                <telerik:EditorTool Name="Paste" /> 

1 Answer, 1 is accepted

Sort by
0
Rumen
Telerik team
answered on 05 Mar 2009, 11:25 AM
Hello Bruno,

The case could be that the editor's original value overwrites the one submitted from the browser. This happens, for example, if you did not put the initial value setting in a if block checking whether the page is postback. Here is what you should do in your Page_Load method:

  If Not Page.IsPostBack Then
                ' Set the editor content from database here
  End If

If this is not the reason for the problem, we ask you to send us a sample project including your aspx page with its codebehind. We will review your code and provide a solution.

You can also see the code of the following example: http://demos.telerik.com/aspnet-ajax-beta/Editor/Examples/edittemplate/defaultcs.aspx

Best wishes,
Rumen
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
Tags
Editor
Asked by
Bruno
Top achievements
Rank 1
Answers by
Rumen
Telerik team
Share this question
or