user2067567
user2067567

Reputation: 3803

Gridview or similar functionality in MVC

Currently am fetching user Entered comments from DB and displaying in View as below

foreach (var item in Model.lstCommet)
                                    {
        <span class="comment_time">@Html.formattedDateTime(item.dTime.Value) </span>
        <span> : </span>
         <span class="comment_body">@item.displayComments</span> 
         <br />
        }

And am planning to add EDIT and DELETE functionality for each items. How can i do this in MVC ?

Like if user clicks Edit it should make a textbox and after editing they submit.

In asp.net we use gridview or other stuffs and capture. how do i do here ?

Thanks

Upvotes: 1

Views: 166

Answers (1)

Rab
Rab

Reputation: 35572

Welcome to MVC. first you have to do all html part yourself here. thats what MVC is all about

1) you can do it with Jquery, creat a form make it hidden and then on click of edit button load values to textboxes etc and make the form visisble

2) Create a separte view for edit and on edit click go to that view with required Id etc and load the form in edit mode and do saving etc.

you can use WebGrid also which will help you creating grid, not with all you need, but its something

Upvotes: 1

Related Questions