Advertise with us

Call server function in server tag

Can I call my function inside my server tag?

public string Mytext()
{
}

And

<asp:Label ID="lbl" runat="server" Text="Mytext()"><asp:Label>

Last updated:8/23/2014 8:51:52 AM

1 Answers

Sumit Kesarwani
Sumit Kesarwani

Hi Ashish, 


Yes, using Expression syntax, e.g.,

<asp:Label ID="lbl" runat="server" Text="<%$ Mytext() %>"><asp:Label>

Answer