I’d like to initialise the label of the button from function from code behind:
<asp:Button ID="BtnAjoutClient" runat="server" Text='<%= GetText()%>' />
and in the code behing a simple function like:
protected String GetText() {
return "test";
}
But the caption of the button shows me the raw code (and the function is never called). I tryied also <%# GetText() %>. Do you know why ?
Regards
You can’t use
<%=%>server side code block like that within a server side control.Use the code behind file: