---
title: "javascript function on data-bind"  
description: "javascript function on data-bind"  
author: "Takeshi Okada"  
published: 2014-08-22  
updated: 2014-08-22  
canonical: https://www.mindstick.com/forum/2091/javascript-function-on-data-bind  
category: "asp.net"  
tags: ["asp.net"]  
reading_time: 1 minute  

---

# javascript function on data-bind

Is there a way i can call [JavaScript function](https://www.mindstick.com/forum/2090/send-data-from-asp-dot-net-code-behind-to-a-javascript-function) on data-bind like this:

<span id="lblSomePropVal" data-bind="text: MySomeFunction(SomeProperty())" ></span>

What i [am trying](https://answers.mindstick.com/qa/36834/which-two-programming-languages-should-i-master-in-if-i-am-trying-to-get-into-google-or-facebook) to do is call MySomeFunction with the value of SomeProperty of my viewmodel. My SomeFunction will return some text based on value passed and that will be displayed in the span lblSomePropVal.

I tried it the way i have written in the example but it throws [binding](https://www.mindstick.com/blog/146/dynamic-binding-in-c-sharp) error.

Am i [missing](https://answers.mindstick.com/qa/52138/international-missing-children-s-day-2019-was-observed-on) something here or is there any other way of doing this?

This is the error i [am getting](https://www.mindstick.com/forum/34179/i-am-getting-error-while-assigning-the-data-to-the-array-list):

[Microsoft](https://www.mindstick.com/articles/12301/microsoft-is-trying-to-kill-passwords) JScript [runtime](https://www.mindstick.com/articles/52/creating-timer-at-runtime-in-c-sharp-dot-net) error: Unable to parse bindings.

[Message](https://www.mindstick.com/forum/12802/show-confirmation-message-yes-or-no-in-asp-dot-net): [object Error];

Bindings value: text: MySomeFunction(SomeProperty())

## Replies

### Reply by Sumit Kesarwani

Hi Takeshi, \

<td data-bind="text: $root.MySomeFunction(SomeProperty)"></td>


---

Original Source: https://www.mindstick.com/forum/2091/javascript-function-on-data-bind

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
