Click here to Skip to main content
15,920,629 members
Please Sign up or sign in to vote.
4.00/5 (1 vote)
I have use DetailView.In that i have use many controls like TextBox,Checkbox,DropdownList etc with many validation controls likes Required Field Validator,Compare Validator,Custom Validator etc to performed different types of Validation on given values.

I want to add one feature when user click on update button in Edit mode of this Detailview its check that value(s) of any controls is change & all chnaged values are valid than its asked for confirmation about changes & if any changed value is not correct than validation message is fire..How to achieve this...Not that during entire process page is not post back while asking for confiramtion in case of all changed values are correct or fire validation message. Page is only postback when user click on OK button of confimation window to change value.

I have use Hiddenfield but problem is that for each controls of detailview i have to use seprate hiddenfield..is there any other simple approach to achieve this requierment...?
Posted
Updated 4-Sep-12 18:15pm
v3
Comments
AmitGajjar 5-Sep-12 0:32am    
Do you have single table to update all this information ?
NothingToLoose 5-Sep-12 1:03am    
I am interested to apply this feature in all forms of my web application. For some forms i have to deal with single table & for some forms i have to deal with multiple tables..but in all forms i have use Detailview...
AmitGajjar 5-Sep-12 1:06am    
To keep track on changed value, you also need to store previous value. And i don't think it is feasible. but if it is compulsory then other workarround is, you can create javascript function and that will work on lost focus of all your control to check if previous value is similar or not. If form is changed then you make one flag in hiddenfield to true(means form is changed).
NothingToLoose 5-Sep-12 2:48am    
Your Suggested approch allready done by me earlier before posting this question.Let me know about other alternative simple solution if you have any idea about it
AmitGajjar 5-Sep-12 2:50am    
In your scenario you are using hiddenfield for each control. I am not doing that.

1 solution

 
Share this answer
 
Comments
NothingToLoose 5-Sep-12 2:40am    
I think you did't clearly undestand about my requirment.Above link did't give solution...Following are steps i have to keep in mind for this
- First Check value of any control(s) is changed in edit mode of Detailview
- If yes than when user click on update button & if any changed value is not proper than validation message is fired by concern validation control(s).No post back during this process.
- If all changed value is proper & user click on Update button than Confirmation window with Two buttons(OK,Cancle) Generate with Message Like "Record is Modify.Are you Sure to Continue?"...No Postback during this Process.
-If user click on OK button of Confirmation window than Post back of Page Occured & Record is Modify...
- In edit Mode if user has not Change value of any controls & press on update button than again Generate confirmation window with Message like "Record is NOT Modify.Are you sure to continue?".(No postback)If user click on OK than Detailview is change to Insert Mode from Edit Mode.
Now..Keeping all these steps in Mind if you have any solutions than suggest me.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900