将文本框值从视图传递到操作方法,并在给定条件下返回true false [英] Passing text-box value from view to action method and return true false on given condition

查看:71
本文介绍了将文本框值从视图传递到操作方法,并在给定条件下返回true false的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个文本框和一个按钮。如果我在文本框中输入adm并单击该按钮,则该值将传递给控制器​​以执行操作方法。在那里它将检查文本框中的给定值是否为adm。如果它是adm,那么它将在警告框中显示true,如果它不是adm,那么它将在警告框中返回false。我很困惑如何实现整个事情。请帮忙。我的教员告诉我使用jquery。

解决方案

观看此视频: MVC 4:MVC4中的JQuery Alert Box [ ^ ]

I have a text box and a button. If I put "adm" in the text box and click on the button, the value will get passed to the controller to an action method. There it will check whether the given value in the text box is "adm" or not. If its "adm" then it will show "true" in an alert box and if its not "adm" then it will return "false" in an alert box. I am confused how to implement the whole thing. Please help. I have been told to use jquery for that by my faculty.

解决方案

Watch this video: MVC 4: JQuery Alert Box in MVC4[^]


这篇关于将文本框值从视图传递到操作方法,并在给定条件下返回true false的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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