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

You call javacript function by using this line of code

System.Web.UI.ScriptManager.RegisterClientScriptBlock(Page, typeof(Page), "nameOfKey", "yourFunctionName()", true);

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.