I have a web page with a datalist in it that binds to a datatable. Within
the template I call a function to process one of fields and return the data.
This worked perfectly until I moved the template into a separate file and
specified DataList1.ItemTemplate = Page.LoadTemplate("template.ascx") in
code behind. Now I get the error: Name 'MyFunction' is not declared. If I
removed MyFunction from the template file it displays the page properly.
Example (works when the template is part of the web page but not as a
separate file):
<%# MyFunction(DataBinder.Eval(Container, "DataItem.MyField")) %>
Anyone know what the problem is?