This is driving me nutty... I've got a simple hello world user control, with a label on the ascx page.
When i insert the macro into the RTE, it actually renders correctly, sending the macro parameter value to the label... but when i view the actual page from the front end, it doesnt execute any of the code-behind stuff.
This has really got me stumped... any suggestions as to what i might be doing wrong?
Code is as follows:
Code:
namespace HelloWorldUmbracoWebApp
{
using System;
using System.Data;
using System.Drawing;
using System.Web;
using System.Web.UI.WebControls;
using System.Web.UI.HtmlControls;
/// <summary>
/// Summary description for WebUserControl1.
/// </summary>
public class TestWebUserControl : System.Web.UI.UserControl
{
private string m_MessageText;
protected System.Web.UI.WebControls.Label myLabel;
protected System.Web.UI.WebControls.Label myLabel2;
protected System.Web.UI.WebControls.Literal mainLiteral;
private void Page_Load(object sender, System.EventArgs e)
{
myLabel.Text = "Hello i'm a label";
myLabel2.Text = m_MessageText;
}
#region Web Form Designer generated code
override protected void OnInit(EventArgs e)
{
//
// CODEGEN: This call is required by the ASP.NET Web Form Designer.
//
InitializeComponent();
base.OnInit(e);
}
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.Load += new System.EventHandler(this.Page_Load);
}
#endregion
public string MessageText
{
set
{
m_MessageText = value;
}
}
}
}
And the ascx page:
Code:
<%@ Control Language="c#" AutoEventWireup="false" Codebehind="HelloWorldUmbracoWebApp.ascx.cs" Inherits="HelloWorldUmbracoWebApp.TestWebUserControl" TargetSchema="http://schemas.microsoft.com/intellisense/ie5"%>
<div>
Hello World!
<br>
<asp:Label ID="myLabel" Runat="server"></asp:Label>
<asp:Label Id="myLabel2" Runat="server"></asp:Label>
</div>
All i see on the front-end is "Hello World", with no errors
In the umbraco admin RTE, where i inserted the Macro, it renders the following:
Hello World!
Hello i'm a label Control Text from Macro
Hoping somebody can help .. i'm sure its somethign simple, just i cant see it. :|
thanks all
greg