D
Davíð Þórisson
Trying to migrate from ASP... been scratching my head for almost 12 hours
now on this task that should be so easy, wtf can't I access the asp:label
control from my .cs code??? It returns no errors but simply no text is
inserted...
I have 3 pages;
*** default.aspx ***
<%@ Register TagPrefix="UserControls" TagName="Initializer"
Src="initializer.ascx" %>
<UserControls:Initializer runat="server" />
*** initializer.ascx ***
<%@ Control Src="initializer.cs" EnableViewState="False" %>
<asp:label id="myLabel" text="here I want the text" runat=server/>
*** initializer.cs ***
using System.Web.UI.WebControls;
public class Initializer
{
protected Label myLabel;
void Page_Load(object sender, System.EventArgs e)
{
Label myLabel = new Label();
myLabel.Text = "and I have success";
}
}
now on this task that should be so easy, wtf can't I access the asp:label
control from my .cs code??? It returns no errors but simply no text is
inserted...
I have 3 pages;
*** default.aspx ***
<%@ Register TagPrefix="UserControls" TagName="Initializer"
Src="initializer.ascx" %>
<UserControls:Initializer runat="server" />
*** initializer.ascx ***
<%@ Control Src="initializer.cs" EnableViewState="False" %>
<asp:label id="myLabel" text="here I want the text" runat=server/>
*** initializer.cs ***
using System.Web.UI.WebControls;
public class Initializer
{
protected Label myLabel;
void Page_Load(object sender, System.EventArgs e)
{
Label myLabel = new Label();
myLabel.Text = "and I have success";
}
}