简体   繁体   English

调用操作以在AjaxRequest中呈现部分View

[英]Call action to render a partial View in a AjaxRequest

How you doing? 你好吗? I hope its good. 我希望它很好。

I have a "View" called Create and another two "partial" "views", a view is used to render a bootstrap modal and other to render a table, when I do a post in this modal I must to update that table, but when the model state of the modal is invalid I must call his action, how can I do this? 我有一个称为“创建”的“视图”和另外两个“部分”“视图”,一个视图用于呈现引导程序模态,其他用于呈现表,当我在该模态中发布时,我必须更新该表,但是当模态的模型状态无效时,我必须打电话给他,我该怎么做? I tryed to use return PartialView("ModalProduto", model); 我试图使用return PartialView(“ ModalProduto”,model);

try something like this 尝试这样的事情
function () { 函数(){

                $.ajax({
                    url: URL/PartialViewAction,
                    type: 'GET',
                    data: $(form1.).serialize(), // or make your objects for the partial
                    success: function (data) {
                        $("#placeforthepartialview_as_a_modal").html(data);

                    },
                    error: function (e, data) {

                    }
                });
            });

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM