I'm currently working with a code behind file that includes a method:
public string ProductsAsJson()
This method is responsible for returning a JSON representation of multiple products. In order to integrate some Angular functions into my ascx page, I am attempting to call the function using the following code snippet:
<script type="text/javascript">
var products = <%# ProductsAsJson() %>;
Unfortunately, this approach is not successfully retrieving the list of products. Can anyone help me understand what might be going wrong?