I am trying to call a function defined in code behind from Label.Text but it's not working. Here is the code... code in .aspx file
<asp:Label runat="server" Text='<%# GetPagingCaptionString() %>' ID="pagenumberLabel"></asp:Label>
code block from code behind
public string GetPagingCaptionString()
{
int currentPageNumber = Convert.ToInt32(txtHidden.Value);
int searchOrderIndex;
if (int.TryParse(Convert.ToString(Session["searchOrderIndex"]), out searchOrderIndex))
{
return string.Format("{0} to {1} orders out of {2}", (currentPageNumber * 20) + 1,
(currentPageNumber + 1) + 20, GetItemsCount(searchOrderIndex.ToString()));
}
return String.Empty;
}
Can anyone tell me what's wrong here.