DataTables editor

DataTables editor

herculeshercules Posts: 21Questions: 9Answers: 0
edited May 2017 in Free community support

I have a question regarding using the Generator. First, I was wondering why when I add the id or primary key field, when I try to save the fields I get an error message stating that the editor automatically generates the id field in my DataTable, but when i run my application I do not see this field. Second, it automatically structures my application as an MVC application when I just want a simple web form application. Thanks for any help.

This question has an accepted answers - jump to answer

Answers

  • allanallan Posts: 63,889Questions: 1Answers: 10,530 Site admin

    You won't see the id parameter in the model because it is automatically added into the model structure at run time. It is the third parameter that is passed into the Editor constructor that defines the primary key column name.

    Regarding the second question, Generator currently doesn't have an option to generate a web form .NET application. It builds a Web API application as that fits well with how Editor works, but there is no reason why you couldn't use it to build your controller code and then move it into your own web form.

    Allan

  • herculeshercules Posts: 21Questions: 9Answers: 0

    Thanks for replying to my question. But I was wondering why I do not see the id field in my Datatable when it is displayed in the browser. Thanks !

  • allanallan Posts: 63,889Questions: 1Answers: 10,530 Site admin
    Answer ✓

    Because it is rare that you would want to display the primary key value to the end user - it is meaningless to the end user. But if you did want to display it you could add it as a Field with .Get(false).

    Allan

This discussion has been closed.