ASP.NET MVC Ajax OnBegin/Complete Javascript Problem

Posted by mrkcsc on Stack Overflow See other posts from Stack Overflow or by mrkcsc
Published on 2010-03-21T23:36:04Z Indexed on 2010/03/21 23:41 UTC
Read the original article Hit count: 327

Filed under:
|
|
|

Hello,

I am trying to fire off a javascript method using the OnBegin AjaxOption in an Ajax method.

However, when debugging with firebug the callback in unable to find the Javascript method and I do not know why.

My code is simple, first I use a basic Ajax method like this:

<%= Ajax.ActionLink("Testing", "Testing", new AjaxOptions { OnBegin = "RunThisThing" }) %>

Then under it I decalre this script.

    <script type="text/javascript">

        function RunThisThing {
            alert("WORK")
        }
    </script>

Yet when I try running the page and clicking on the link, Firebug tells me "RunThisThing is not defined".

Any idea what I might be doing wrong?

© Stack Overflow or respective owner

Related posts about ASP.NET

Related posts about mvc