开发者

call server function in server tag

can i call my function inside my server tag?

public string Mytext()
{
}

And

<as开发者_开发知识库p:Label ID="lbl" runat="server" Text="Mytext()"><asp:Label>


You can do:

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


Yes, using Expression syntax, e.g.,

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

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜