I have a controller that is being called twice from an ActionLink call.
My home page has a link, that when clicked calls the Index method on the Play controller. An
My issue was resolved by making sure I wasn't double referencing my JavaScript
files, which I was.
This was causing the action to be hit twice when I clicked the link.
I know the above has been said before but I thought I would point out that it's worth checking to see if your files are being loaded twice, especially if you're using Partial Views
.
I noticed that in one of my Partial Views
I was telling it to use the main layout page which contained the scripts that were responsible for what happened when I clicked on the links. So I fixed this by just setting layout = null;
since it's a partial view anyway and is already being loaded inside of the main layout.