Home Show an actionlink in a tooltip mvc razorview
Reply: 1

Show an actionlink in a tooltip mvc razorview

user7221204
1#
user7221204 Published in 2017-11-13 17:45:05Z

I have a datatable with Edit,Delete actionlinks in each row. Instead of showing them as a column in the table, I would like to show them in a tooltip to save space. I am not sure how this can be achieved. I would like the tooltip to appear on the @rowNo.ToString("000") field. Thanks for the help. My code is as follows:

 <tbody>
            @foreach (var item in Model)
                {
                    rowNo++;
                <tr>
                    <td>
                        @rowNo.ToString("000")

                        @Html.ActionLink("Edit", "Edit", new { id = item.Id }) 
| @Html.ActionLink("Delete", "Delete", new { id = item.Id })
                        </td>
    </tr>
    </tbody>
thmshd
2#
thmshd Reply to 2017-11-13 17:56:28Z

It really depends on your HTML Framework. Assuming, you might probably use Bootstrap, I'd suggest something like Dropdowns. I think, by the example, you get the point...

<div class="dropdown show">
  <a class="btn btn-secondary dropdown-toggle" href="#" role="button" id="dropdownMenuLink" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
    Actions...
  </a>

  <div class="dropdown-menu" aria-labelledby="dropdownMenuLink">
    @Html.ActionLink("Edit", "Edit", new { id = item.Id }, new { @class = "dropdown-item" }) 
    @Html.ActionLink("Delete", "Delete", new { id = item.Id }, new { @class = "dropdown-item" })
  </div>
</div>
You need to login account before you can post.

About| Privacy statement| Terms of Service| Advertising| Contact us| Help| Sitemap|
Processed in 0.295633 second(s) , Gzip On .

© 2016 Powered by mzan.com design MATCHINFO