G
Guest
I've got a really annoying problem, and I feel like i've tried everything ....
I've got a really simple usercontrol, containing a single dropdown.
In the Page_Load of the usercontrol, i want to set the items of the drop
down, but the control reference in the code behind file is always undefined.
the id is correct and I've created lots of user control before and never had
this problem. what am i missing??
ascx
<%@ Control Language="c#" AutoEventWireup="false"
Codebehind="SelectorControl.ascx.cs" Inherits="MyNameSpace.SelectorControl"
TargetSchema="http://schemas.microsoft.com/intellisense/ie5"%>
<aspropDownList id="DropDownList1" runat="server"
Width="256px"></aspropDownList>
namespace MyNameSpace
{
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 CurrencySelectorControl.
/// </summary>
public class CurrencySelectorControl : System.Web.UI.UserControl
{
protected System.Web.UI.WebControls.DropDownList DropDownList1;
private void Page_Load(object sender, System.EventArgs e)
{
// DropDownList1 == null
}
#region Web Form Designer generated code
}
}
please help?
I've got a really simple usercontrol, containing a single dropdown.
In the Page_Load of the usercontrol, i want to set the items of the drop
down, but the control reference in the code behind file is always undefined.
the id is correct and I've created lots of user control before and never had
this problem. what am i missing??
ascx
<%@ Control Language="c#" AutoEventWireup="false"
Codebehind="SelectorControl.ascx.cs" Inherits="MyNameSpace.SelectorControl"
TargetSchema="http://schemas.microsoft.com/intellisense/ie5"%>
<aspropDownList id="DropDownList1" runat="server"
Width="256px"></aspropDownList>
namespace MyNameSpace
{
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 CurrencySelectorControl.
/// </summary>
public class CurrencySelectorControl : System.Web.UI.UserControl
{
protected System.Web.UI.WebControls.DropDownList DropDownList1;
private void Page_Load(object sender, System.EventArgs e)
{
// DropDownList1 == null
}
#region Web Form Designer generated code
}
}
please help?