Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Certain controls aren't accessable at runtime in a custom control

Reply
Thread Tools

Certain controls aren't accessable at runtime in a custom control

 
 
Eric Sabine
Guest
Posts: n/a
 
      01-27-2005
I've created a custom control (ascx) which contains a tree view, a drop
down list, and a listbox. The custom control is included in a web form
and at runtime, won't compile (I get the "inaccessible due to its
protection level" error) because the NodePopulate event of the treeview
is set to private. So I changed it to "protected" and the app compiles
fine and runs and properly reacts to the event. Good.

The problem is inside that event, I reference the "SelectedValue"
property of both the dropdownlist and the listbox. At runtime in this
event, both resolve to empty strings ("") but I know both controls have
do have an item selected, so there seems to be some type of access
issue. Any idea?

Eric

 
Reply With Quote
 
 
 
 
=?Utf-8?B?U2hhdw==?=
Guest
Posts: n/a
 
      01-28-2005
I think, you need to create properties in user (custom) control level which
access child control’s properties. A book said to do that way, but I haven’t
try it yet.

Shaw


"Eric Sabine" wrote:

> I've created a custom control (ascx) which contains a tree view, a drop
> down list, and a listbox. The custom control is included in a web form
> and at runtime, won't compile (I get the "inaccessible due to its
> protection level" error) because the NodePopulate event of the treeview
> is set to private. So I changed it to "protected" and the app compiles
> fine and runs and properly reacts to the event. Good.
>
> The problem is inside that event, I reference the "SelectedValue"
> property of both the dropdownlist and the listbox. At runtime in this
> event, both resolve to empty strings ("") but I know both controls have
> do have an item selected, so there seems to be some type of access
> issue. Any idea?
>
> Eric
>
>

 
Reply With Quote
 
 
 
 
Edward W.
Guest
Posts: n/a
 
      01-28-2005
What? The custom control contains 3 controls. Are you saying the custom
control should also expose a property of itself and thus in the event
handler of one of the controls, the custom control should refer to itself?
that makes no sense. Please explain a little better what you are trying to
say. You make no sense.


"Shaw" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
>I think, you need to create properties in user (custom) control level which
> access child control's properties. A book said to do that way, but I haven't
> try it yet.
>
> Shaw
>
>
> "Eric Sabine" wrote:
>
>> I've created a custom control (ascx) which contains a tree view, a drop
>> down list, and a listbox. The custom control is included in a web form
>> and at runtime, won't compile (I get the "inaccessible due to its
>> protection level" error) because the NodePopulate event of the treeview
>> is set to private. So I changed it to "protected" and the app compiles
>> fine and runs and properly reacts to the event. Good.
>>
>> The problem is inside that event, I reference the "SelectedValue"
>> property of both the dropdownlist and the listbox. At runtime in this
>> event, both resolve to empty strings ("") but I know both controls have
>> do have an item selected, so there seems to be some type of access
>> issue. Any idea?
>>
>> Eric
>>
>>



 
Reply With Quote
 
=?Utf-8?B?U2hhdw==?=
Guest
Posts: n/a
 
      01-28-2005
I mean that the outside of user control, such as page, tries to access child
controls of that user control.

Shaw


"Edward W." wrote:

> What? The custom control contains 3 controls. Are you saying the custom
> control should also expose a property of itself and thus in the event
> handler of one of the controls, the custom control should refer to itself?
> that makes no sense. Please explain a little better what you are trying to
> say. You make no sense.
>
>
> "Shaw" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
> >I think, you need to create properties in user (custom) control level which
> > access child control's properties. A book said to do that way, but I haven't
> > try it yet.
> >
> > Shaw
> >
> >
> > "Eric Sabine" wrote:
> >
> >> I've created a custom control (ascx) which contains a tree view, a drop
> >> down list, and a listbox. The custom control is included in a web form
> >> and at runtime, won't compile (I get the "inaccessible due to its
> >> protection level" error) because the NodePopulate event of the treeview
> >> is set to private. So I changed it to "protected" and the app compiles
> >> fine and runs and properly reacts to the event. Good.
> >>
> >> The problem is inside that event, I reference the "SelectedValue"
> >> property of both the dropdownlist and the listbox. At runtime in this
> >> event, both resolve to empty strings ("") but I know both controls have
> >> do have an item selected, so there seems to be some type of access
> >> issue. Any idea?
> >>
> >> Eric
> >>
> >>

>
>
>

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Smtp Send Mail on Exchange Server Box CDO.Object Not accessable. Bruce Hodge ASP .Net 0 02-15-2006 03:08 AM
the best way to have some information accessable to all pages? Annie ASP .Net 1 09-07-2005 01:38 PM
File and printer sharing - network path is not accessable =?Utf-8?B?TGF3cmVuY2UgQw==?= Wireless Networking 4 07-30-2005 03:45 PM
Friend variable scope not accessable through object Dominic ASP .Net 0 11-03-2004 07:47 PM
PC "Not Accessable!" =?Utf-8?B?U3RldmUgQmVkZm9yZA==?= Wireless Networking 2 09-13-2004 01:42 AM



Advertisments