how to put <%# DataBinder.Eval(Container, "DataItem.Code") %> to string in aspx file?
like <% string str = DataBinder.Eval(Container, "DataItem.Code") %>?
I am getting error The name ‘Container’ does not exist in the current context
how to put <%# DataBinder.Eval(Container, DataItem.Code) %> to string in aspx file? like <%
Share
You could write a helper function in your code behind which will return the required string:
and then in your view whenever you needed the value you could call this function:
This way you no longer need a variable.