I am working on ASP.NET MVC3 application. In my razor view I use @HTML.ActionLink
to implement delete functionality for my custom image gallery. However when I show enlarged image I want to hide this link, and when the user clicks it back to thumb size I want to show the link again.
Here is my razor code:
<span class="document-image-frame">
@if (image != null)
{
<img src="file:\\105.3.2.7\upload\@image.Name" alt="docImg" style="cursor: pointer;" />
@Html.ActionLink("Изтрий", "DeletePicture", new { documentImageID = image.Id }, new { @class = "delete" })
}
</span>
Then my jQuery script:
$('.document-image-frame img').click(function () {
$(this).parent().toggleClass("document-image-frame");
//$(this).parent().child('a').hide();
})
This part - $(this).parent().toggleClass("document-image-frame");
is working fine but I don't know how to access the actionlink in order to show-hide it.