The same way as you would anything else that you want to access from other
pages. Just make sure it is not declared as part of the class for the page,
it can be easy to accidentally make an enum part of the page when you don't
want to. Or if you would like you can simply stick it in a separate file,
this might help you keep it organized as not being part of the codebehind.
--
Nathan Sokalski njsokalski@hotm ail.com
On Sep 17, 8:45 pm, bruce barker <nos...@nospam. comwrote:
this is a bad practice. pages should not access each other. the proper
way is to move the enum to a class file in the app code folder.
>
-- bruce (sqlwork.com)
>
oaksong wrote:
I've got an enum in a code behind page. It's set as public enum. How
do I access it from another page?
>
tia
Chris
I have a class file in the app code folder. I put the enum into that
file. When I tried to reference it from a codebehind page it produced
an error.
On Sep 18, 11:36 am, oaksong <oaks...@hotmai l.comwrote:
>
On Sep 17, 8:45 pm, bruce barker <nos...@nospam. comwrote:
>
this is a bad practice. pages should not access each other. the proper
way is to move the enum to a class file in the app code folder.
>
-- bruce (sqlwork.com)
>
oaksong wrote:
I've got an enum in a code behind page. It's set as public enum. How
do I access it from another page?
>
tia
Chris
>
I have a class file in the app code folder. I put the enum into that
file. When I tried to reference it from a codebehind page it produced
an error.
>
What was the error? (nobody can help you if you just say "an error")- Hide quoted text -
>
- Show quoted text -
>
The enum is named 'cpage'.
The error is: error BC30451: Name 'cPage' is not declared.
The error means (I'm pretty sure) that the enum is not in scope.
Without code, It's hard to diagnose. Here are some tips:
1. Is the enum inside of a class and/or namespace?
1.1 If in a class, is it declared "Public"?
1.2 If in a namespace, is the namespace imported in the page that you
are attempting to access it?
Note: If you do end up finding the problem, make sure you post it so
other people know the fix.
On Sep 18, 1:52 pm, Norm <neon...@gmail. comwrote:
>
On Sep 18, 11:36 am, oaksong <oaks...@hotmai l.comwrote:
>
On Sep 17, 8:45 pm, bruce barker <nos...@nospam. comwrote:
>
this is a bad practice. pages should not access each other. the proper
way is to move the enum to a class file in the app code folder.
>
-- bruce (sqlwork.com)
>
oaksong wrote:
I've got an enum in a code behind page. It's set as public enum.. How
do I access it from another page?
>
tia
Chris
>
I have a class file in the app code folder. I put the enum into that
file. When I tried to reference it from a codebehind page it produced
an error.
>
What was the error? (nobody can help you if you just say "an error")-Hide quoted text -
>
- Show quoted text -
>
The enum is named 'cpage'.
The error is: error BC30451: Name 'cPage' is not declared.
>
The error means (I'm pretty sure) that the enum is not in scope.
Without code, It's hard to diagnose. Here are some tips:
>
1. Is the enum inside of a class and/or namespace?
1.1 If in a class, is it declared "Public"?
1.2 If in a namespace, is the namespace imported in the page that you
are attempting to access it?
>
Note: If you do end up finding the problem, make sure you post it so
other people know the fix.
The reference was out of scope. I needed to import my enums class.
Thanks!
Comment