I have a problem with an aspx page.Interesting thing about it , it worked before but now it didn’t.
I want to call a server side method from an aspx page : Here is my aspx code:
<asp:TextBox ID="lblo" runat="server" Text='<%#GetPanelImageURL()%>' ></asp:TextBox>
And my server side code :
public string GetPanelImageURL()
{
return "asdasd";
}
This is not working.Can anybody help?
<%# .. %>are used for data-binding expressions. Data-binding expressions are resolved when theDataBindmethod of a control or of thePageclass is called. For controls such as theGridView,DetailsView, andFormViewcontrols, data-binding expressions are resolved automatically during the control’sPreRenderevent and you are not required to call theDataBindmethod explicitly (from here).So you don’t call a
DataBindmethod for this control, and this expression is not evaluated.