This one has me stumped and I've spent countless hours trying to find a
solution. I have a UserControl being called from my main .aspx page.
main-page.aspx:
<%@ Register TagPrefix="my" TagName="control" Src="~/tmpcontrol.ascx"
%>
....
<my:control id="my-control1" runat="server" SomeVal="TestString" />
....
tmpcontrol.ascx:
<%@ Control Language="C#" AutoEventWireup="true"
CodeFile="tmpcontrols.ascx.cs" Inherits="tmpcontrols" %>
......
tmpcontrols.ascx.cs:
public partial class tmpcontrol : System.Web.UI.UserControl
{
private string _someVal = "";
public string SomeVal
{
get { return _someVal; }
set { _someVal = value; }
}
protected void Page_Load(object sender, EventArgs e)
{
Response.Write("** Value: " + _someVal + " **<br />");
}
}
When the page loads it does not print anything for _someVal. Anyone
have any ideas why? This one is killing me... Thanks for any help.