使文本字段只读 [英] making a text field read only

查看:143
本文介绍了使文本字段只读的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用下面的代码来使文本条目只读,但这不会成为只读的理由,为什么这可能是

I am using the code below to make the text entry read only but this does not become read only any idea why this could be

@Html.EditorFor(model => model.UserName, new { Readonly = "Readonly"})


推荐答案

为什么继续使用

Why cont you use

@Html.EditorFor(model => model.UserName, new { @readonly = true});

或者您可以像

or you can use like

@Html.EditorFor(model => model.UserName, new { @readonly = "readonly"});

这篇关于使文本字段只读的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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