locked
How to audit web page content changes in classic asp.net? RRS feed

  • Question

  • User-609535877 posted

    I am required to audit web content change on classic asp.net web pages which contain textbox, dropdown list, radio list ….server controls. Once these  values are updated to save into sql database by Update server button control click event, data change including old value to new value into a audit table. Which is better way to audit this kind of data changes?

    Thanks in advance!

    Tuesday, June 25, 2019 1:55 AM

Answers

  • User-821857111 posted

    I obtain a copy of the record prior to the change and save it serialised to JSON along with the modified record in the audit table. I used Diffplex to display a diff: https://github.com/mmanela/diffplex

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Tuesday, June 25, 2019 12:45 PM

All replies

  • User475983607 posted

    I am required to audit web content change on classic asp.net web pages which contain textbox, dropdown list, radio list ….server controls. Once these  values are updated to save into sql database by Update server button control click event, data change including old value to new value into a audit table. Which is better way to audit this kind of data changes?

    Your question is not detailed enough to answer accurately but usually this type of logic is handled using SQL and SQL scripts.

    A common solution is to craft an SQL trigger. 

    https://docs.microsoft.com/en-us/sql/t-sql/statements/create-trigger-transact-sql?view=sql-server-2017

    Another very common pattern is writing a simple SELECT INTO to copy a record from the target table to the audit table.

    Tuesday, June 25, 2019 11:02 AM
  • User-1038772411 posted

    Hello, zhao790

    I am providing you one reference link that will help you to how you can achieve as per your requirement. please refer it.

    https://www.codeproject.com/Articles/1019511/Audit-Trail-and-Data-Versioning-with-Csharp-and-MV

    Thanks.

    Tuesday, June 25, 2019 11:52 AM
  • User-821857111 posted

    I obtain a copy of the record prior to the change and save it serialised to JSON along with the modified record in the audit table. I used Diffplex to display a diff: https://github.com/mmanela/diffplex

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Tuesday, June 25, 2019 12:45 PM