6 Answers, 1 is accepted
Please have in mind that the .ClientTemplate() is executed on the client and it does not have access to the C# classes which are defined on the server.
When the .ClientTemplate() is used we recommend using a custom function on the client to perform the calculations and return the value:
Let me know if you need additional information on this matter.
i will try with custom function,
but c# class working with static data (john.smith) in .ClientTemplate()
what is difference? wrong parenthesis or wrong double quotes or single quotes?
my class getting string as "#=userusername#"... Not with dynamic value...
I still think the same thing. i think the problem is quotes or parenthesis...
by the way;
i made some controller modification and now every users pictures are listing perfectly. i'am getting full image location from controller.
so i'm not using class in .ClientTemplate
But i still want to how I can use dynamic variable in class("x") instead of static data.
I'm glad to hear that the functionality is working as expected.
As for passing the value dynamically, as mentioned the template is executed on the client. The class will be called, but the value passed on it will be evaluated on the client, that is why the value is received as a string originally as it is still not evaluated. Passing directly the value works as the template does not need to be evaluated in order to provide the correct value as the value is already set.
i got it, i am learning Mr. Stefan.