mvc error DtResponse does not contain a definition for PostEdit

mvc error DtResponse does not contain a definition for PostEdit

brendonsbrendons Posts: 39Questions: 14Answers: 1

Having an issue when trying to use PostEdit event with mvc controller

DtResponse response = new Editor(db, "TableName", "tblid") 
.Field(new Field("blah"))
. Process(formData).Data();
response.PostEdit += (sender, e) => UpdateOtherThing(e.Values);

mvc throws this error "DtResponse does not contain a definition for PostEdit"

What am I missing?

This question has an accepted answers - jump to answer

Answers

  • allanallan Posts: 61,433Questions: 1Answers: 10,049 Site admin
    Answer ✓

    It doesn't - it exists on the Editor object. You need to rearrange that code a little:

    Editor editor = new Editor(db, "TableName", "tblid") 
      .Field(new Field("blah"));
    
    editor.PostEdit += (sender, e) => UpdateOtherThing(e.Values);
    
    DtResponse response = editor.Process(formData).Data();
    

    See the examples here.

    Allan

This discussion has been closed.