TextBox Protection Level
I have a webcontrol mycontrol.ascx that has the following textbox:
<asp:TextBox ID="Name" runat="server" Columns="15" />
When I try to access this value from the aspx page that uses the control, I get the following error:
Compiler Error Message: CS0122: 'ASP.Organization_Form_ascx.Name' is inaccessible due to its protection level
However I cannot seem to change the protection level of the textbox within the control. When I add this code:
<script language="c#" runat="server">
public TextBox Name;
I then get this error:
Compiler Error Message: CS0102: The class 'ASP.Organization_Form_ascx' already contains a definition for 'Name'
How do I go about changing the protection level of my TextBox so that I can access it in the aspx page that loads the control?
Top DevX Stories
Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL