1

I have a page, that should update a "process" kinda window when an action is aplied. Kinda like a visible log. Click "start upload" and the div tag underneath will be updated with information.

The problem is, that when i click the "start upload" link it just jumps to that page and don't do a ajax call and update the div.

Controller

public ActionResult ProcessWindow(decimal id)
{
    IMG_SETTINGS_FOLDERS img_settings_folders = db.IMG_SETTINGS_FOLDERS.
        Single(i => i.SETTINGS_FOLDER_ID == id);
    return PartialView("ProcessWindow", img_settings_folders);
}

View

@Ajax.ActionLink("Start upload", "ProcessWindow", 
    new { id = Model.SETTINGS_FOLDER_ID }, 
    new AjaxOptions { UpdateTargetId = "processWindowssssss" })

<div id="processWindowssssss"></div>
jgauffin
  • 99,844
  • 45
  • 235
  • 372
Thomas Hansen
  • 193
  • 2
  • 9
  • possible duplicate of [ASP.Net MVC AJAX link not working](http://stackoverflow.com/questions/934745/asp-net-mvc-ajax-link-not-working) – James Sep 19 '11 at 09:10
  • Doesn't seems like a duplicate, mine doesn't fire a ajax request, it just fires a request. Seem like the "ajax" isn't aplied some how. Even through i can see in the source that it compiles like this – Thomas Hansen Sep 19 '11 at 09:15
  • have you added in your web.config under ``, `` – John x Sep 19 '11 at 09:21
  • And a run through firebug also tells me that all JS files are loaded – Thomas Hansen Sep 19 '11 at 09:24
  • Ensure your script refs are above your Ajax call – John x Sep 19 '11 at 09:34
  • Basic HTML yes... i have my script "links" in my head section and the call in the body ;) – Thomas Hansen Sep 19 '11 at 09:36
  • Solved... When you use unobtrusive ajax, you need to inlcude "jquery.unobtrusive-ajax.min.js"... If people who rite toturials should read this, please exstend you "js" include info to contain this information to. Answer found from Brad Wilson on Unobtrusive Ajax. http://bradwilson.typepad.com/blog/2010/10/mvc3-unobtrusive-ajax.html \T – Thomas Hansen Sep 19 '11 at 10:46

1 Answers1

1

Solved...

When you use unobtrusive ajax, you need to include "jquery.unobtrusive-ajax.min.js"...

If people who write toturials were to read this, please extend your "js" include info to contain this information too.

Answer found from Brad Wilson on Unobtrusive Ajax. http://bradwilson.typepad.com/blog/2010/10/mvc3-unobtrusive-ajax.html

\T

Phil
  • 3,934
  • 12
  • 38
  • 62
Thomas Hansen
  • 193
  • 2
  • 9