0

My code which was working earlier with a Action returning Javascript has suddenly stopped working.

My view shows a jquery dialog and within that dialog when user clicks save button control goes to mvc post which returns

 return JavaScript("OnCreateSuccess('some value')");

Earlier the javascript method use to execute.. now instead, the browser view is replaced with text

OnCreateSuccess('some value');

I know its not the good way of passing information but I inherited this code like it is.

2
  • 1
    are you calling this action using AJAX call ?? return Javascript only works with that. Check more here stackoverflow.com/questions/19541336/… Commented Jul 5, 2016 at 9:38
  • unfortunately it's using $('#form').submit(); I'm working on alternative to replace this to make ajax post Commented Jul 5, 2016 at 9:44

1 Answer 1

0

I rewrote the Action to return JSON and used Ajax call and jquery callback to handle the returned values.

Thanks @Deep

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.