将数据从一个控制器传输到另一个 [英] transfer data from one controller to other

查看:79
本文介绍了将数据从一个控制器传输到另一个的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,

我有一个查看页面,其中有一个文本框和一个动作链接.我想将在文本框中输入的数据传输到另一个控制器.文本框未附加到任何模型.我该怎么做?与创建模型类并声明属性有关吗?如果是这样,我将如何传递文本框数据?



在此先感谢..........

Hi All,

I have a view page where I have a textbox and a actionlink. I want to transfer the data entered in the textbox to another conrtoller . The text box is not attached to any model. How will I do that? Is it something to do with creating a model class and declaring a property? If so how will I pass textbox data?



Thanks in Advance..........

推荐答案

有两种常见的解决方法:
1)使用JavaScript(可能是jQuery)将数据发布到URL
2)使用Html.BeginForm并设置适当的值以定位另一个控制器

干杯.
There are two common approaches to this:
1) use JavaScript (likely jQuery) to post the data to an URL
2) use Html.BeginForm and set the appropriate values to target the other controller

Cheers.


这篇关于将数据从一个控制器传输到另一个的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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