Last post Sep 20, 2006 04:29 PM by samsp
Jun 29, 2006 06:10 PM|VirtueTech|LINK
I have a user control that has 10 hidden input fields in it. In VS2003 I would declare these fields like so:
public HtmlInputHidden edtPast2;
public HtmlInputHidden edtPast1;
Then I was able to gain access to them in my user control like so: UserControl1.edtPast1
Since the conversion I cannot declare the hidden input fields like I did above because it would be declaring it twice and I would get this error:
Error 1 The type 'bedrockip.site.versioning' already contains a definition for 'edtPast1' c:\inetpub\wwwroot\bedrockAtlas\site\versioning.ascx.cs 59 26 http://localhost/bedrockAtlas/
So....I removed the lines above that declared the hidden input fields, and now I can no longer use them like so: UserControl1.edtPast1
Here is the error I get:
Error 1 'base.site.versioning.edtPast1' is inaccessible due to its protection level c:\inetpub\wwwroot\bedrockAtlas\site\address.aspx.cs 321
Can someone please shed some light on how I can solve this issue?
Jul 31, 2006 05:20 PM|VirtueTech|LINK
Sep 20, 2006 04:29 PM|samsp|LINK
the variables in your user control for these html controls are not public, so they can't be accessed from outside the context of that control. If you made the declarations in the user control, then you could make them public. If however they are autogenerated,
then you'll need to provide wrapper properties that delegate to those controls. In which case you may want to rename the html controls to something like m_xxxx so you can have a property xxxx, that provides the external access.