寻找一个Html.SubmitButton帮手,将接受MVC3类属性 [英] Looking for a Html.SubmitButton helper that would accept class attributes in MVC3

查看:68
本文介绍了寻找一个Html.SubmitButton帮手,将接受MVC3类属性的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想用一个帮手在MVC3提交按钮。这样的事情是否可用?如果没有,那么没有人知道我在哪里可以得到一些code这一点。我想一个能够让我通过一个类属性。

I would like to use a helper for Submit button in MVC3. Is such a thing available? If not, then does anyone know where I could get some code for this. I would like one that allows me to pass a class attribute.

推荐答案

是不是很简单只是写

<输入类型=提交级=myclassname/>

在MVC中,有没有这样的事情像控制,即携带大量应用程序逻辑。事实上,这是可能的,但不推荐使用。我想说的是,HTML辅助仅仅做HTML编写更加舒适,帮助你不写重复的code。在特定情况下,我认为这是简单直接写HTML比用帮手。但不管怎么说,如果你想,它包含在 MVC期货库。方法被称为提交按钮

In MVC, there are no such things like controls, that carry much application logic. In fact, it is possible but not recommended. What i want to say is that Html helpers are just making Html writing more comfortable and help you not write duplicate code. In your particular case, i think it is simpler to write direct html than that with helper. But anyways, if you want to, it is contained in MVC Futures Library. Method is called SubmitButton

这篇关于寻找一个Html.SubmitButton帮手,将接受MVC3类属性的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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