Alex
Alex

Reputation: 36101

ASP.NET MVC Ajax.ActionLink's weird behavior

I'm doing the simplest ajax request possible:

public ActionResult SayHello()
    {
        return Content("YYAAAY");
    }

//////////

<div id="Div1">
    <%= Ajax.ActionLink("SAY HELLO", "SayHello", new AjaxOptions { UpdateTargetId = "Div1" })%>
    </div>

It works when I start an empty ASP.NET MVC project, but when I use it in my current project, it displays the whole page recursively instead of YYAAAY phrase only.

Where might be the problem?

Upvotes: 1

Views: 156

Answers (1)

tvanfosson
tvanfosson

Reputation: 532435

I suspect you have an unrelated javascript error that is causing it to use the default action (link) instead of retrieving the content via AJAX. Use Firefox/Firebug and examine the console or turn on script debugging in IE and see.

Upvotes: 1

Related Questions