c# - Only allowing Uppercase characters in a text box -


i working on mvc project in text box allow user enter uppercase characters.

this works in razor when doing following:

    @html.textboxfor(m => m.name, new{@class="upper"} 

i apply relevant code in css file

however if have following code in razor doesnt work:

    @html.textbox("name", new{@class="upper"} 

all text box showing {@class="upper"}

does know doing wrong?

i believe second parameter in @html.textbox helper initial value of textbox. if not want specify initial value either need pass null or empty string , attributes:

@html.textbox( "name", null, new { @class = "upper" }) 

Comments

Popular posts from this blog

How to remove text and logo OR add Overflow on Android ActionBar using AppCompat on API 8? -

html - How to style widget with post count different than without post count -

url rewriting - How to redirect a http POST with urlrewritefilter -