The Cancel command button in the detailsview is set as the CancelControlID for the modalextender (I set it's client naming to static).
Now when I click on a button to show the modal extender, the AJAX async postback works fine, I see my updateprogress conetents, etc. But when I click the Cancel command button in the detailsview, the whole page regreshes.
2nd PROBLEM: The asp.net validation controls within the modal popup don't clear after you resolve the error. So if "Date"is required, after you fill in Date, the errors don't clear and you can't submit.
I am very new to update panels, so not sure why this is happening. Any pointers?
Some of validators are reseted after lost focus of control they bound to (controlToValidate), and others like custom validators are called in the form
pre submit as they are not bound to control instead they rely on the validation group
MCTS
If you feel it helps, Mark as answered so that it can help others to find solution.
For Any further questions, please contact me.
chadwixk
Member
71 Points
92 Posts
DetailsView Command button causing full page refresh
Feb 17, 2012 05:03 PM|LINK
Hello,
I have a something like this, where the modal contains a detailsview used for inserting and editing records that are in the gridview:
<UpdatePanel> <UpdateProgress></UpdateProgress> <GridView></GridView> <Panel> <DetailsView></DetailsView> <Panel> <ModalExtender></modalextendor> </UpdatePanel>The Cancel command button in the detailsview is set as the CancelControlID for the modalextender (I set it's client naming to static).
Now when I click on a button to show the modal extender, the AJAX async postback works fine, I see my updateprogress conetents, etc. But when I click the Cancel command button in the detailsview, the whole page regreshes.
2nd PROBLEM: The asp.net validation controls within the modal popup don't clear after you resolve the error. So if "Date"is required, after you fill in Date, the errors don't clear and you can't submit.
I am very new to update panels, so not sure why this is happening. Any pointers?
Thanks so much in advance!
Chad
Muhammad Fak...
Contributor
2268 Points
511 Posts
Re: DetailsView Command button causing full page refresh
Feb 17, 2012 05:21 PM|LINK
What do you expect from the Cancel button ?
A redirection or what ?
If you feel it helps, Mark as answered so that it can help others to find solution.
For Any further questions, please contact me.
chadwixk
Member
71 Points
92 Posts
Re: DetailsView Command button causing full page refresh
Feb 17, 2012 07:10 PM|LINK
Just to close the modal. No other logic is needed.
Muhammad Fak...
Contributor
2268 Points
511 Posts
Re: DetailsView Command button causing full page refresh
Feb 17, 2012 07:36 PM|LINK
Chnage the asp close button to an Html input to close the modal
If you feel it helps, Mark as answered so that it can help others to find solution.
For Any further questions, please contact me.
chadwixk
Member
71 Points
92 Posts
Re: DetailsView Command button causing full page refresh
Feb 17, 2012 08:19 PM|LINK
Ah...so it won't even call the server side code...I'll try that.
Do you know why the validators don't reset once you correct the values?
Muhammad Fak...
Contributor
2268 Points
511 Posts
Re: DetailsView Command button causing full page refresh
Feb 18, 2012 04:15 AM|LINK
Some of validators are reseted after lost focus of control they bound to (controlToValidate), and others like custom validators are called in the form pre submit as they are not bound to control instead they rely on the validation group
If you feel it helps, Mark as answered so that it can help others to find solution.
For Any further questions, please contact me.