how to perform click to the output of ActionLink by jQuery or javascript?
Posted
by user324003
on Stack Overflow
See other posts from Stack Overflow
or by user324003
Published on 2010-04-23T08:48:36Z
Indexed on
2010/04/23
8:53 UTC
Read the original article
Hit count: 339
<%= Ajax.ActionLink("Edit", "Update", "Home", new { id = item.mID }, new AjaxOptions { OnBegin = "function(){ $('#edit" + item.mID + "').show();}", HttpMethod = "get", UpdateTargetId = "edit" + item.mID })%>
The above code generates the html source code. when user click the link, it works well. But there're so many links there, I must click them one by one. Is there any method to click once, all of them excutes?
I tried the method: $("a.buttonID").click() and modified the above code:
<%= Ajax.ActionLink("Edit", "Update", "Home", new { id = item.mID }, new AjaxOptions { OnBegin = "function(){ $('#edit" + item.mID + "').show();}", HttpMethod = "get", UpdateTargetId = "edit" + item.mID } new{@class="buttonID"})%>
But it doesn't work. Because it only excutes the onclick event of a tag, the href attribute doesn't work.
© Stack Overflow or respective owner