views:

289

answers:

1

I know there are many other questions here regarding similiar situations, but I have been so far unable to find one that fixes my problem, hence this question.

I currently have a page that contains a form, and various fields (as you do) and validators. Some of the fields and validators are within an UpdatePanel as they may have to change depending on the value of a radio button.

After the form has been submitted and the page fails validation, all of the fields within the UpdatePanel that have values entered in them, lose their values completely, but any of the fields outside the panel, do not.

Can anyone shed any light on why this is happening?

I have tried enabling the view state on the UpdatePanel and each of the controls, but to no effect.

edit Some confusion perhaps. I am intending to submit the entire form. The UpdatePanel is contained within the form itself, and I want the data in the UpdatePanel to be submitted with the form. I am not talking here about validating the UpdatePanel ONLY. The reason why I suspect it is the UpdatePanel that's causing the issue is because it's only the fields within it that are losing their values.

Hope that's a bit clearer.

A: 

Hey!

Regarding the information i got from your question it sounds like your updating/refreshing the whole Form. If validation fails...you only have to consider the values that are wrong.

Have you looked at this?

UpdatePanel Examples

Hope this clears it up...

bastianneu
I am, but that's what it's supposed to do. The form contains an updatepanel but when Submit is clicked, it's to submit the entire form, including what's contained in the updatepanel. If that makes sense?
Ian Devlin
It is submitting the whole form to your validation...if validation fails it do not submit the data...and does not update the whole form...just the values that were wrong.
bastianneu
Yes I know that, but the problem is that the values that do pass the validation, are lost and no longer display on the form and would have to be re-entered. That is the problem.
Ian Devlin
arrrgh okay this is annoying...sry i got your first post wrong.
bastianneu
That's ok, thanks for trying and the link you posted was useful for some things I didn't know and I've learnt from it, sadly nothing helps with this current problem and it seems that no-one else has come across it either (judging from the incredibly poor number of responses).
Ian Devlin