I have this statemen at the beginning:
<%@ Control Language="C#" AutoEventWireup="true" CodeFile="ucCreditCard.ascx.cs"
Inherits="UserControls_Common_ucCreditCard" %>
in ucCreditCard.ascx.cs I have this:
using System;
using System.Text;
using System.Text.RegularExpressions;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
public partial class UserControls_User_ucCreditCard : System.Web.UI.UserControl
{
//
}
When I try to reference any of the simple control like Textbox etc, I always get control 'xxx' does not exist in current content. What can be the problem?
Thanks in advance :)
Hope You are missing the designer file, as these errors mostly occur only in such cases, Right click and
convert to web application.
should do the trick.Also do check that its the same as the partial class defined in your .cs file
Here the solution. You missing to declare the project.
select "Convert to web application" it will create new .aspx.designer.cs file. Then Build would resolve the problem
To illustrate what V4Vendetta sayed ther is an exemple inyour case with a dropDownList.
UserControls_Common_ucCreditCard.ascx
ucCreditCard.ascx.designer.cs
ucCreditCard.ascx.cs
You must have changed the name of your file but did not update the name of your class:
You have:
should be
as indicated in the .aspx portion of your code.