0
@{
  Project1.Controllers.HomeController.Method1(ID, Cust_Name);
}

In above, how to pass ID (int) and Cust_Name (string) from Javascript?

1
  • Have you tried anything so far? Commented Jun 24, 2016 at 12:30

1 Answer 1

1

You cannot call server side code with client side variables... You will have to look into perhaps using AJAX or some other way of getting the variables back to the server.

Consider the JQuery ajax method: http://api.jquery.com/jquery.ajax/

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

1 Comment

I meant to say Pass values from JavaScript to MVC method.

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.