OldValues and NewValues collections are empty

Discussion in 'ASP .Net Web Services' started by Doug Kent, Jul 30, 2008.

  1. Doug Kent

    Doug Kent Guest

    When my FormView uses its ObjectDataSource to save changes, in the FormView's
    ItemUpdating handler, the FormViewUpdateEventArgs OldValues and NewValues
    collections are both completely empty.

    The FormView is bound to an ObjectDataSource. The
    ObjectDataSource has DataObjectTypeName, OldValuesParameterFormatString
    and ConflictDetection set as shown below:

    <asp:ObjectDataSource ID="ListingsDataSource" runat="server"
    TypeName="Listing"
    SelectMethod="GetListingWithAgent"
    UpdateMethod="Update"
    DataObjectTypeName ="Listing"
    OldValuesParameterFormatString ="oldEntity"
    ConflictDetection ="CompareAllValues"
    >

    <selectparameters>
    <asp:QueryStringParameter QueryStringField="lid"
    Type="Int32" Direction="Input" Name="Listing_ID" />
    <asp:QueryStringParameter QueryStringField="ts"
    Type="String" Direction="Input" Name="timeStampEncoded" />
    </selectparameters>
    </asp:ObjectDataSource>

    The FormView DefaultMode is "Edit", the bound controls in the EditTemplate
    are populated by the FormView no problem (using "Bind"). No problem with
    selecting.

    The FormView looks like this:


    <asp:FormView ID="ListingFormView" runat="server"
    DataSourceID="ListingsDataSource"
    DataKeyNames="ID,Timestamp"
    DefaultMode="Edit"
    AllowPaging="false">


    Anyone have a clue what could be causing this behavior? Thanks!
    Doug Kent, Jul 30, 2008
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Mark Olbert

    GridView: Empty OldValues, NewValues

    Mark Olbert, Jan 19, 2006, in forum: ASP .Net
    Replies:
    6
    Views:
    12,336
    jfortier2
    Jul 22, 2006
  2. LamSoft
    Replies:
    0
    Views:
    364
    LamSoft
    Jul 5, 2007
  3. rahulsurya
    Replies:
    0
    Views:
    496
    rahulsurya
    Dec 12, 2007
  4. Marius Manolea
    Replies:
    0
    Views:
    1,009
    Marius Manolea
    Jun 4, 2008
  5. Doug Kent

    OldValues and NewValues collections are empty

    Doug Kent, Jul 30, 2008, in forum: ASP .Net Web Controls
    Replies:
    4
    Views:
    876
    Doug Kent
    Jul 31, 2008
Loading...

Share This Page