Search code examples
asp.netasp.net-ajaxpagemethods

Asp.net: save data entry form with PageMethods


The problem: I have a data entry form. I would like to save the data without page roundtrip or UpdatePanels.

The solution: - the 'Save' button calls a javascript function which serialize all the fields content (client side) - the javascript function calls a web method (server side) - the web method deserialize the data and save it to the database.

Am I doing right?


Solution

  • In a word: yes


    In more than a word: yes you are doing it one way which is a good implementation.

    Points to think about are security of the service (if on a public site), serialisation of the data methods - json is probably easiest to process both client side and server side.