Reputation: 313
When I start my MVC application I want to call:
$.ajax({
url: "@Url.Action("CreateInstance", "Home")",
type: "POST"
});
This works! But I want to call it only once. If I switch from page to page this function is still getting called. I only want to call the function if I start the project. Is this possible?
Upvotes: 0
Views: 62
Reputation: 377
You probably want to call the code directly in your global.asax . If you aren't outputting any data to the page, why use ajax?
Upvotes: 2