Detect Changes on ASP Wizard steps

48 Views Asked by At

I have a ASP wizard with 5 steps. First Step is mandatory and you have to finish that, then only you can access other steps.
Step 1: Adds student in the database and returns the studentID of newly created student.
Step 2: Family information and address.
Step 3: Previous education.
Step 4: Comments and misc information.
Step 5: Review and submit.

The issue here is after i finish step 1, i land on step 2, Then if i go back on step 1 with Previous button and click next i want to detect if i have changed any information on step 1 or not. If i have updated any form filed then i should do a UPDATE query and if there is no update then DO NOTHING. Same goes for all the steps. I want to detect if ViewState is changed or not to reduce unnecessary updates queries every time user go back and forth.

 if(ViewState["FirstName"] != null)
        {
           FNameField.Text = ViewState["FirstName"].ToString();
        }
    else
        {
           FNameField.Text = null;
        }  

This would be the obvious solution but there are lot of information on each step and i was wondering if there is any better solutions then comparing each filed one by one.

Thanks

0

There are 0 best solutions below