How to display the warning message in asp.net mvc ?


Warning_Msg

while working in asp.net mvc we will get scenario to display the alert or warning message while deleting or editing the record, then we can achieve that functionality by using this code as given below


// Alert message for edit record
@Html.ActionLink("Edit","Index",new {Id=item.Id},new { onclick = "return confirm('Are you sure do you want to edit the record ?');" })
// Alert message for delete the record.
@Html.ActionLink("Delete","Delete",new {Id=item.Id},new { onclick = "return confirm('Are you sure you wish to delete this record "+@item.Id +"?');" })

How to make multiline text box in asp.net MVC


If you are working on asp.net mvc and you got the scenario to make Multiline text box, where user can enter the long text.

Then you can do like this

Step 1 : Take the @html.TextAreaFor html helper

Step 2: Increase the height and weight of TextArea like this

@Html.TextAreaFor(model => model.Answer,5, 55, null)

Note : Here Model.Answer is the part of my model class.