inline server tag not working for asp.net control

1.2k Views Asked by At

Following is not working

    <asp:TemplateField HeaderText='<%=class.getText("Address")%>' SortExpression="FirstName">blah blah</asp:TemplateField>

I cannot use "#" as this is not databind element i.e HeaderText='<%#class.getText("Address")%>'

1

There are 1 best solutions below

1
On

Then you have to set the HeaderText property in the backed, in PageInit most likely. ASP.NET server controls cannot have ASP original server tags in it, only markup can.