将信息从一个页面传递到另一个ASP.NET MVC5 [英] Passing info from one page to another ASP.NET MVC5

查看:85
本文介绍了将信息从一个页面传递到另一个ASP.NET MVC5的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


你好,

我生成了一个模型,视图和控制器,用于添加新建筑物。

还有一个主页面,我放置了一个TextBox。

我想让用户输入建筑物ID并点击下面的按钮

然后该操作应该带我进入Create Building页面,但是带上
建筑ID并填充"参考"创建建筑"页面上的字段。

我怎样才能做到这一点?



推荐答案

您好

通常,您可以通过AJAX请求实现此目的。将输入字段放入AJAX表单并使用"了解更多"按钮将信息发布到控制器。

Typically you would achieve this through an AJAX request. Put the entry field into an AJAX form and use the 'Learn More' button to post the information to your controller.

控制器的响应应该是部分视图,并根据传递的参考填充模型。

The response from the controller should be a partial view with the model populated based on the passed reference.

快速查看本文:

http://www.c-sharpcorner.com/UploadFile/9405d4/Asp-Net-mvc-partial-updates-using-unobtrusive- ajax-and-jquer /

http://www.c-sharpcorner.com/UploadFile/9405d4/Asp-Net-mvc-partial-updates-using-unobtrusive-ajax-and-jquer/

有意义吗?

问候,

D


这篇关于将信息从一个页面传递到另一个ASP.NET MVC5的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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