G
Guest
I'm having some issues with using a Response.Write or the shortcut ( <%= ...)
from within a label control. I cannot do this in the code behind, I need to
do it here at runtime. I have a public function (GetMsgs) in my code behind
page that returns a string back to the caller. I want to call this function
from the ASPX page and return the value to a Label control.
I have tried the following options but cannot get it to work:
1)
<asp:Label Runat="server" ID="lblSelectedMessages"
CssClass="span_normal_bold_altcolor" Text='<%= GetMsgs() %>' />
2)
<asp:Label Runat="server" ID="lblSelectedMessages"
CssClass="span_normal_bold_altcolor" Text='<% Response.Write(GetMsgs()) %>' />
3)
<asp:Label Runat="server" ID="lblSelectedMessages"
CssClass="span_normal_bold_altcolor">
<%= GetMsgs() %>
</asp:Label>
from within a label control. I cannot do this in the code behind, I need to
do it here at runtime. I have a public function (GetMsgs) in my code behind
page that returns a string back to the caller. I want to call this function
from the ASPX page and return the value to a Label control.
I have tried the following options but cannot get it to work:
1)
<asp:Label Runat="server" ID="lblSelectedMessages"
CssClass="span_normal_bold_altcolor" Text='<%= GetMsgs() %>' />
2)
<asp:Label Runat="server" ID="lblSelectedMessages"
CssClass="span_normal_bold_altcolor" Text='<% Response.Write(GetMsgs()) %>' />
3)
<asp:Label Runat="server" ID="lblSelectedMessages"
CssClass="span_normal_bold_altcolor">
<%= GetMsgs() %>
</asp:Label>