0

So here is the thing its been days since im trying to solve this, i'm debuggin a project from the company i work, its a web system, and here is the thing i have a javascript file which im going to call 'docart.js' and a core file which i will call 'operationscart.cs' so that i need to do is call the following function from the docart.js file for example

docart.js
file located like so: web/domain/models/docart.js

app.viewModel.doCart = {

this.AddCharge = function(id,pad){

//code is in here
}


}

So what i want to perform is from the class operationcart.cs i want to be able to call that .js function example

location: Core/Domain/Actions/operationcart.cs

private void PrepareCheckout {

//call to js function goes here

}

thanks in advance if someones knows how to solve my problem

Edited by __avd: Wrong forum

3
Contributors
2
Replies
18
Views
3 Years
Discussion Span
Last Post by M.Waqas Aslam
0

If you've ASP.NET MVC project then 'PrepareCheckout()' should be an action method and you can request via jQuery.ajax. If not then create AJAX Service component, add PrepareCheckout method in it and request it via jQuery.ajax function.

0

you can do something like this

Page.ClientScript.RegisterStartupScript(this.GetType(),"CallMyFunction","MyFunction()",true);
This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.