I have an MVC project that is mixed with TypeScript. I need my TypeScript object to obtain a string from my C# class.
I have a c# static class that produces a string from a StringBuilder.
I have a typescript class that I need to be able to access this string.
So in my constructor of the TypeScript class I would like to be able to:
this.element.append(MyCSharpStaticString);
Is there any way that I can do this ?
Relevant Code
cshtml
<div id="GridDiv"></div>
<script type="text/javascript">
jQuery(function () {
new Jobber.OrdersGrid($('#GridDiv'), {}).init();
Q.initFullHeightGridPage($('#GridDiv'));
});
</script>
typescript :
export class OrdersGrid extends Serenity.EntityGrid<OrdersRow, any> {
protected getHeaderHtml(reportName) { return OrderHeaderHtml.HtmlHeader(reportName); }
constructor(container: JQuery) {
super(container);
// Finds this element in the code and adds our HTML
this.element.find('.grid-container').prepend(this.getHeaderHtml(""));
}
}
Razor?asp.net-mvctag, but it wasn't you, so you should clarify.