This project is read-only.

JsActions is not defined

Jan 7, 2012 at 6:25 PM

I have done what you said on your Document Page

Unable to find @Html.JsAction() method

Then i have used  @Html.JsScript() on my _layout.chtml page

But no luck it gives

"Error: JsActions is not defined
Source File: http://localhost:2638/
Line: 42"

Then I have downloaded your test project from following link

An run this application on my pc

This also give same error. I have used your latest version and also previous version but unable to get output.

Hope you will help me.



Jan 8, 2012 at 8:01 AM

Hello and thank you for your post.

I think your issue is due to mistakes using the helper.
I have uploaded a new minimal working test project that may be used as a guideline, you can download it here.

If you will not able to make it work anyway, upload YOUR project and let me download it, i will be happy to check it.
Vincenzo Chianese

Jan 8, 2012 at 9:44 AM
Edited Jan 8, 2012 at 9:44 AM

Thanks for replay.

I have downloaded your test project and run my pc.

After running it gives following out put  (including error)

Hope you will help me.

Jan 9, 2012 at 6:54 PM

Your issue is very strange, since downloading test project MUST work.
Anyway i do not have firefox and javascript error handling can change from browsers to browsers.
Thank to another user i have fixed a javascript quoted string issue that may deny JsAction work propely at all. (thanks to vendi_naren) -> and it has been solved in 0.3.2

My suggest is to download again test project, upgrade to 0.3.2 using nuget and test again.
Let me know the result!
Vincenzo Chianese.

Jan 10, 2012 at 4:53 AM

Thanks for replay.

Your extension  @Html.JsScript() doesn't write anything on my source page.

Thats why i have added following line of code manually

<script type="text/javascript" src="/JsAction?data="></script>

and then added following script on index page

<script type="text/javascript">
    $(document).ready(function () {
        JsActions.MyTestMethod(10, 15).then(function (data) { alert(data); });

It shows output something like when i run my app by pressing F5

If i run my app by pressing Ctrl + F5 then it shows previous error menas

JsActions is not defined

Hope you will help me.



Jan 10, 2012 at 10:48 AM

The output from flickr link is the right one, since the JSON object returned is 150 (look at the controller source code).
It's very very strange that HtmlHelper has no output. It simply injects that code in your page (

It may be another kind of issue. May you upload your project? I will download it and check if something is wrong.

Jan 11, 2012 at 11:15 AM

I have uploaded test project for your kind consideration.


Here i have also upload a picture(image) showing error message.

If i press f5 only then it runs ok. if i press ctrl + F5 then it shows error like uploaded image.

Hope u will help me.

Jan 17, 2012 at 1:47 PM
Edited Jan 17, 2012 at 1:48 PM

I opened your project and i see that you're still using JsAction 0.1 (with less features and more bugs).
However it works.
Use nuGet and upgrade to 0.3.2 right now!

P.S -> The right test project is this one:
Download, test but remember always to check for updates!

Vincenzo Chianese