O
oaksong
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
do I access it from another page?
tia
Chris
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)
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 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.