S
Steve Hershoff
Hi everybody,
I have a question about asp.net's labels and the DataBind method. I have a
method in a code-behind page (this is VisualStudio 2003 btw) that
(simplified) looks like this:
public string GetName()
{
string sName = "";
if(Session["ds"] != null)
sName = Session("fname").ToString() + " " +
Session("lname").ToString();
return sName;
}
My label code says this:
<asp:Label CssClass="Normal2" Runat="server" ID="Label124">
<%# GetName() %>
</asp:Label>
The thing is, I can't execute GetName() unless I call Label124.DataBind() in
my code-behind. Is there a way to do it without the DataBind() call?
I have a question about asp.net's labels and the DataBind method. I have a
method in a code-behind page (this is VisualStudio 2003 btw) that
(simplified) looks like this:
public string GetName()
{
string sName = "";
if(Session["ds"] != null)
sName = Session("fname").ToString() + " " +
Session("lname").ToString();
return sName;
}
My label code says this:
<asp:Label CssClass="Normal2" Runat="server" ID="Label124">
<%# GetName() %>
</asp:Label>
The thing is, I can't execute GetName() unless I call Label124.DataBind() in
my code-behind. Is there a way to do it without the DataBind() call?