Reputation: 1413
if I have an ajax form with AjaxOptions like this :
(Ajax.BeginForm(new AjaxOptions { UpdateTargetId = "okContent", HttpMethod = "Post", LoadingElementId = "ajaxLoader" })
is it possible to change UpdateTargetId in controller(after pressing submit button)?
Thank You.
Upvotes: 1
Views: 770
Reputation: 8237
No, you can't do that. And if you could that would have been a violation of the mvc pattern. The controller shouldn't know about your html structure.
Upvotes: 1
Reputation: 532465
No. The target id is not sent. It is only used in the javascript callback to determine which element to update with the returned HTML content. If you need more control over what happens on return, I suggest using the jQuery library's AJAX methods instead.
Upvotes: 1