Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ASP.NET Razor View Html.TextBox size/width

Tags:

asp.net

razor

Is there a way to set a textbox size without using CSS (setting the columns or size attribute) ? If so, how?

 @Html.TextBox("redeemamt", @Model.Amount)
like image 668
Reinard Avatar asked Apr 10 '12 08:04

Reinard


2 Answers

@Html.TextBox("redeemamt", @Model.Amount, new {style = "width: 100px;"})

or you could try with this:

@Html.TextBox("redeemamt", @Model.Amount, new { size = "100" })
like image 55
Nielsen Ramon Avatar answered Nov 07 '22 20:11

Nielsen Ramon


Sounds like you're looking for Html.TextArea:

@Html.TextArea((string)name, (string)value, (int)rows, (int)columns, (object)htmlAttributes)

like image 24
brichins Avatar answered Nov 07 '22 21:11

brichins