AjaxOptions.confirm does not pop up in ActionLink or BeginForm Submit

New to this, so bear with me if I missed this somewhere in another answer. I tried using AjaxOptions in Ajax.BeginForm and it did not pop up, so I switched to testing it in an ActionLink instead, and still can’t get it to work. For both the ajax.beginform and the ajax.actionlink it goes to the correct controller and carries on fine, but I get no confirmation message.

What am I doing wrong?

Thanks,
K

From View:

<script type="text/javascript" src="/Scripts/jquery.unobtrusive-ajax.min.js"></script>

@Ajax.ActionLink(
"Revoke Access to all Galleries Immediately", 
"ViewInvites", 
"Gallery", 
new AjaxOptions { 
    Confirm = "Are you sure you want to revoke access to all galleries? This cannot be undone.",
    HttpMethod = "Post"
}
)

Answers:

Thank you for visiting the Q&A section on Magenaut. Please note that all the answers may not help you solve the issue immediately. So please treat them as advisements. If you found the post helpful (or not), leave a comment & I’ll get back to you as soon as possible.

Method 1

Be sure the script tag is actually pointing to the correct script. You may need to specify a relative path.

 <script src="../Scripts/jquery.unobtrusive-ajax.min.js" type="text/javascript" ></script>

Firebug is helpful for discovering if this is the issue.


All methods was sourced from stackoverflow.com or stackexchange.com, is licensed under cc by-sa 2.5, cc by-sa 3.0 and cc by-sa 4.0

0 0 votes
Article Rating
Subscribe
Notify of
guest

0 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x