473,383 Members | 1,785 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,383 software developers and data experts.

is not accessible in this context because it is 'Protected'

I've read through the google posts on this topic and am still unclear of the
solution.

Simply I have a user control that contains form controls and I would like to
reference the values in the form from the aspx page that contains the user
control. The error message received is:
Compiler Error Message: BC30390: 'ASP._userdetails_ascx.Company' is not
accessible in this context because it is 'Protected'.

Thanks

Murphy
Nov 18 '05 #1
6 1805
You have to wrap access to your form fields using properties or methods, or
make your form fields public.

"Murphy" <mu****@murphy.com> wrote in message
news:Oo**************@TK2MSFTNGP09.phx.gbl...
I've read through the google posts on this topic and am still unclear of the solution.

Simply I have a user control that contains form controls and I would like to reference the values in the form from the aspx page that contains the user
control. The error message received is:
Compiler Error Message: BC30390: 'ASP._userdetails_ascx.Company' is not
accessible in this context because it is 'Protected'.

Thanks

Murphy

Nov 18 '05 #2
Protected means that only the class in which the member is defined
or derived classes, have access to this member.
You must inherit the class or change the member access modifier to Public.
Sharon.

"Murphy" <mu****@murphy.com> wrote in message
news:Oo**************@TK2MSFTNGP09.phx.gbl...
I've read through the google posts on this topic and am still unclear of the solution.

Simply I have a user control that contains form controls and I would like to reference the values in the form from the aspx page that contains the user
control. The error message received is:
Compiler Error Message: BC30390: 'ASP._userdetails_ascx.Company' is not
accessible in this context because it is 'Protected'.

Thanks

Murphy

Nov 18 '05 #3
Thanks Peter,

This is inline with what I discovered in google however I am new to asp.net
and don't understand what this involves.
Does this mean including a including a html "Public" tag in the ascx or
similar ?

Thanks

Murphy

"Peter Rilling" <pe***@nospam.rilling.net> wrote in message
news:uA**************@TK2MSFTNGP09.phx.gbl...
You have to wrap access to your form fields using properties or methods, or make your form fields public.

"Murphy" <mu****@murphy.com> wrote in message
news:Oo**************@TK2MSFTNGP09.phx.gbl...
I've read through the google posts on this topic and am still unclear of the
solution.

Simply I have a user control that contains form controls and I would like to
reference the values in the form from the aspx page that contains the

user control. The error message received is:
Compiler Error Message: BC30390: 'ASP._userdetails_ascx.Company' is not
accessible in this context because it is 'Protected'.

Thanks

Murphy


Nov 18 '05 #4
Thanks Sharon, could you please explain further how this can be achieved.

Murphy

"Sharon" <ta*******@hotmail.com> wrote in message
news:us****************@tk2msftngp13.phx.gbl...
Protected means that only the class in which the member is defined
or derived classes, have access to this member.
You must inherit the class or change the member access modifier to Public.
Sharon.

"Murphy" <mu****@murphy.com> wrote in message
news:Oo**************@TK2MSFTNGP09.phx.gbl...
I've read through the google posts on this topic and am still unclear of the
solution.

Simply I have a user control that contains form controls and I would like to
reference the values in the form from the aspx page that contains the

user control. The error message received is:
Compiler Error Message: BC30390: 'ASP._userdetails_ascx.Company' is not
accessible in this context because it is 'Protected'.

Thanks

Murphy


Nov 18 '05 #5
You set the visibility in code, where you define the object. Look in your
code-behind.

"Murphy" <mu****@murphy.com> wrote in message
news:#p**************@TK2MSFTNGP11.phx.gbl...
Thanks Peter,

This is inline with what I discovered in google however I am new to asp.net and don't understand what this involves.
Does this mean including a including a html "Public" tag in the ascx or
similar ?

Thanks

Murphy

"Peter Rilling" <pe***@nospam.rilling.net> wrote in message
news:uA**************@TK2MSFTNGP09.phx.gbl...
You have to wrap access to your form fields using properties or methods,

or
make your form fields public.

"Murphy" <mu****@murphy.com> wrote in message
news:Oo**************@TK2MSFTNGP09.phx.gbl...
I've read through the google posts on this topic and am still unclear of
the
solution.

Simply I have a user control that contains form controls and I would like
to
reference the values in the form from the aspx page that contains the

user control. The error message received is:
Compiler Error Message: BC30390: 'ASP._userdetails_ascx.Company' is

not accessible in this context because it is 'Protected'.

Thanks

Murphy



Nov 18 '05 #6
Peter, The object is defined with the following code:

<asp:TextBox id="Company" runat="server" MaxLength="50"
size="50"></asp:TextBox>

As opposed to being defined in vb code such as:

Private Sub CreateMyMultilineTextBox()
' Create an instance of a TextBox control.
Dim textBox1 As New TextBox()

' Set the Multiline property to true.
textBox1.Multiline = True
' Add vertical scroll bars to the TextBox control.
textBox1.ScrollBars = ScrollBars.Vertical
' Allow the RETURN key to be entered in the TextBox control.
textBox1.AcceptsReturn = True
' Allow the TAB key to be entered in the TextBox control.
textBox1.AcceptsTab = True
' Set WordWrap to True to allow text to wrap to the next line.
textBox1.WordWrap = True
' Set the default text of the control.
textBox1.Text = "Welcome!"
End Sub

With the object being set as a web form control how can I make it public ?

Thanks

Murphy

"Peter Rilling" <pe***@nospam.rilling.net> wrote in message
news:uZ**************@TK2MSFTNGP12.phx.gbl...
You set the visibility in code, where you define the object. Look in your
code-behind.

"Murphy" <mu****@murphy.com> wrote in message
news:#p**************@TK2MSFTNGP11.phx.gbl...
Thanks Peter,

This is inline with what I discovered in google however I am new to asp.net
and don't understand what this involves.
Does this mean including a including a html "Public" tag in the ascx or
similar ?

Thanks

Murphy

"Peter Rilling" <pe***@nospam.rilling.net> wrote in message
news:uA**************@TK2MSFTNGP09.phx.gbl...
You have to wrap access to your form fields using properties or
methods,
or
make your form fields public.

"Murphy" <mu****@murphy.com> wrote in message
news:Oo**************@TK2MSFTNGP09.phx.gbl...
> I've read through the google posts on this topic and am still
unclear of the
> solution.
>
> Simply I have a user control that contains form controls and I would

like
to
> reference the values in the form from the aspx page that contains
the user
> control. The error message received is:
> Compiler Error Message: BC30390: 'ASP._userdetails_ascx.Company' is

not > accessible in this context because it is 'Protected'.
>
> Thanks
>
> Murphy
>
>



Nov 18 '05 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Adriano Coser | last post by:
I'm getting the following error: error C3767: PictureSource - candidate function(s) not accessible when accessing a public member function of a managed class, either from managed or unmanaged...
4
by: Jack Wright | last post by:
Dear All, I would like to read the processModel from machine.config. The following is code I have writte Dim hConfig As Object = ConfigurationSettings.GetConfig("system.web/processModel") But if...
6
by: Murphy | last post by:
I've read through the google posts on this topic and am still unclear of the solution. Simply I have a user control that contains form controls and I would like to reference the values in the...
3
by: Tim Zych | last post by:
If I declare a procedure in a webform as Public and attach it to a button in the same webform, it runs fine. If I change it to Private Sub and try to click it i get the error: ...
1
by: Patrick.O.Ige | last post by:
Hi, I declared ItemTypes as:- Dim ItemTypes As New ArrayList Outside the Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load and have a function...
5
by: Fred | last post by:
Following what I think are relevant portions of my code: ---------------Begin Code--------------------- Public Class LOLoadingBoard Inherits System.Web.UI.Page Dim MaxNum As Integer Dim LNToEd...
2
by: Steven T. Hatton | last post by:
Can somebody explain why making T a friend of either B or C will permit the code to compile? class A{ protected: A(){} }; class T; class B: protected A {protected: B(){}/*friend class T;*/};...
14
by: mlimber | last post by:
In an article on the safe bool idiom (http://www.artima.com/cppsource/safeboolP.html), Bjorn Karlsson gives the following code (slightly modified): class safe_bool_base { protected: typedef...
3
by: eBob.com | last post by:
I'm getting this error on this statement ... Dim TA_rect As Rectangle = CType(Me.ClientRectangle.memberwiseclone(), Rectangle) "Me" inherits from UserControl. I'm not an OOD guru but maybe...
0
by: flashleo | last post by:
A strange problem i am facing i bind DataList on link button Argument Event. <asp:DataList id="DataList2" runat="server" horizontalalign="Left" repeatdirection="Horizontal" repeatcolumns="3"...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.