如何在文本框中添加两个数字并显示结果 [英] How Can I Add Two Number And Show Result In Textbox

查看:99
本文介绍了如何在文本框中添加两个数字并显示结果的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是mvc的初学者,



i有视图,其中有三个文本框(firstnumber,secondnumber,result)和按钮。
$ b点击按钮$ b,数字(在文本框中输入firstnumber和secondnumber)应该相加并再次显示在文本框中(结果)。





我们将如何在控制器上调用actionmethod点击按钮(没有ajax,jquery)。以及我们如何将在文本框中输入的数据传递给actionmethod。

i am beginner in mvc ,

i am having view in which there are three textbox(firstnumber, secondnumber, result) and button.
on click of button , numbers(entered in textbox firstnumber and secondnumber) should be summed and again shown in textbox(result).


how we will call actionmethod in controller on click of button(without ajax,jquery).and how we will pass data entered in textbox to actionmethod.

推荐答案

你可以创建一个包含三个字段的模型类并传递给相应的视图。
you can create one model class with three fields and pass to respective view.


这篇关于如何在文本框中添加两个数字并显示结果的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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