在单个视图.NET MVC中添加更新和删除到SQL数据库 [英] Add update and delete to SQL database in a single view .NET MVC

查看:58
本文介绍了在单个视图.NET MVC中添加更新和删除到SQL数据库的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何在单个视图中添加,更新和删除,或者不重定向到.net mvc中的另一个页面



尽可能请不要做ajax或javascript



谢谢



我尝试过:



将整个列表作为局部视图并将其显示到另一个视图以假装它没有重定向但转换不顺畅。

How do i Add, Update and Delete in a single view or without redirecting to another page in .net mvc

as much as possible please don't recommend to do ajax or javascript

Thanks

What I have tried:

Making the whole list as partial view and display it to the other view to pretend that it did not redirects but transition is not smooth.

推荐答案

您好,



您可以使用部分视图概念提交表单数据,并在成功时重新加载相同的部分视图。参考下面的代码:



主要表格:
Hello,

You can use Partial view concept for submit your form data and reload the same partial view on success. Refer below code:

Main Form:


(文件).ready(function(){

fneRegConfiguration();

});



(document).ready(function () {
fneRegConfiguration();
});

//loading eReg configuration partial view
    function fneRegConfiguration() {


.ajax({
type: POST
url: ../ Home / _eRegConfiguration
成功: function (响应){
// 将partail视图表分配给div
.ajax({ type: "POST", url: "../Home/_eRegConfiguration", success: function (response) { // assign partail view table to div


这篇关于在单个视图.NET MVC中添加更新和删除到SQL数据库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆