How To Declare TextArea Different Ways In MVC

In this article i explain you how to declare TextArea in mvc
1st Form :-TextArea with name
    @Html.TextArea("txtName")
2nd Form :-TextArea name and value
    @Html.TextArea("txtName","value")
3rd Form :-TextArea name,value and styles
    @Html.TextArea("txtName", new { id="txtId",style="background-color:green"})
4th Form :-TextArea using dictionary
    @Html.TextArea("txtAddress", new Dictionary<string, object>() { { "id", "txtAddress" }, { "class","class1"} })
5th Form :-TextArea name,value and id
    @Html.TextArea("txtName", "value", new { id="txtId",@class="class1"})
6th Form :-TextArea name,value , id and style using dictionary
    @Html.TextArea("txtName", "value", new Dictionary<string, object>() {{"id","txtId"},{"style","color:green"}})

7th Form :-TextArea name,value,rows,cols and id 
    @Html.TextArea("txtName", "value", 5, 75, new { id="txtId",@class="class1"})
8th Form :-TextArea name,value,rows,cols and id using dictionary
    @Html.TextArea("txtName","value",5,75,new Dictionary<string,object>(){{"id","txtId"},{"style","color:green"}})

No comments:

Post a Comment