I have created a Webgrid at server side in asp.net Mvc 3.0. The data columns are added there now I want to create columns for Edit and Delete functionality It was created at client side but when I execute It shows only one column which was created for Delete/Edit.Now I want to merge the client side and server side coding (The server side coding is done in class). So Please help me to solve the problem how can I create the grid with all the columns.
1 Answer
<td class="iconActions">
<a href='@Url.Action("Details", "Contacts", New With {.id = item.ID})' class="ss_sprite ss_application_view_detail" alt="View Detail" title="View Detail" />
</td>
<td class="iconActions">
<a href='@Url.Action("Edit", "Contacts", New With {.id = item.ID})' class="ss_sprite ss_application_edit" alt="Edit" title="Edit" />
</td>
<td class="iconActions">
<a href='@Url.Action("Delete", "Contacts", New With {.id = item.ID})' class="ss_sprite ss_cross" alt="Delete" title="Delete" />
</td>
In my case, @Url.Action was used because I wanted icons instead of worded links and needed to do that with css classes.
Hope this helps.
3 Comments
user655336
Can u send me the code of edit and delete. The data has to be edit and delete in Sql server
user655336
Is this possible using Webgrid?
Ed DeGagne
The edit and delete are handled by the controller action code. As far as the webgrid, I tend to stay away from it and build my "grids" myself.