But i need to use ajax. Is there a correct way to pass values on postback in this case? I know that i can use TempData, but i'm not sure that this is the best approach.
Thanks for your patience
Thanks for your response... Js validation is working already. I re-initialize js validation on ajax request. But i need server side validation as on post there might be an error
Model is null on postback in ajax loaded partial view
Hi,
I'm using the following pattern https://github.com/filamentgroup/Ajax-Include-Pattern to load partial views through ajax.
View:
With Action:
Loads partial view perfectly.
// No need to add partial view i think
Post action works correctly as well:
The problem is, that i need to add model error to CurrentUmbracoPage if it exists in post...
For example:
In this case i get null values for current model. And this happens only when i use ajax.
If i load action synchronously like that:
everything works like it should.
But i need to use ajax. Is there a correct way to pass values on postback in this case? I know that i can use TempData, but i'm not sure that this is the best approach. Thanks for your patience
Hi ProgProger,
Yes, this is a problem of AJAX requests, can you implement js validation?
Thanks,
Alex
Hi Alex,
Thanks for your response... Js validation is working already. I re-initialize js validation on ajax request. But i need server side validation as on post there might be an error
is working on a reply...