![]() |
![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
| Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks. |
| |||||||
![]() |
| |
| | #1 (permalink) |
| | problem with enum in web custom control Hi, i wrote a web custom control, that adds a search option to list box. on of the properties are the position of the textbox that serves are search, the position is Enum (Up, Down). the code looks like that : namespace SearchList { public Enum SearchListLoacation { Up,Down } [DefaultProperty("Text"),ToolboxData("<{0}:SearchList runat=server></ {0}:SearchList>")] public class SearchList : WebControl,INamingContainer { private SearchListLocation _SearchLocation; public SearchListLocation SearchLocation { get {return _SearchLocation;} set {_SearchLocation = value;} } ...... } } (HTML) <div> <cc1:SearchList ID="SearchList1" runat="server" AutoPostBack="True" SearchLocation="Down" /> </div> when i try to compile the code (custom control + website) i receive the following msg ; SearchList.SearchList does not contain a definition for 'SearchListLocation' . the project is framework 2 version. what can cause this kind of error ? Rony, |
My System Specs![]() |
| | #2 (permalink) |
| | Re: problem with enum in web custom control It sounds like either a reference that hasn't updated, or confusion because of the naming. Is that the exact error message? I would have expected the message to match the property, not the type - after all, to get the type (from just the property name) it must have resolved the type! Can you confirm whether both the aspx and the error message are verbatim? I also have my doubts about the wisdom of names that lead to "SearchList.SearchList" - that is a recipe for confusion. Marc |
My System Specs![]() |
| | #3 (permalink) |
| | Re: problem with enum in web custom control On Aug 18, 9:46*am, Marc Gravell <marc.grav...@xxxxxx> wrote: Quote: > It sounds like either a reference that hasn't updated, or confusion > because of the naming. Is that the exact error message? I would have > expected the message to match the property, not the type - after all, to > get the type (from just the property name) it must have resolved the > type! Can you confirm whether both the aspx and the error message are > verbatim? > > I also have my doubts about the wisdom of names that lead to > "SearchList.SearchList" - that is a recipe for confusion. > > Marc Thanks, is seems that the designer can't understand when the namespace and the class are with the same name. |
My System Specs![]() |
| | #4 (permalink) |
| Vista Business x64 | Re: problem with enum in web custom control Did you cut and paste the code? There is a typo if you did. Your enum: public Enum SearchListLoacation { Up,Down } |
My System Specs![]() |
| | #5 (permalink) |
| | Re: problem with enum in web custom control On Aug 19, 3:47*am, breitak67 <gu...@xxxxxx-email.com> wrote: Quote: > Did you cut and paste the code? There is a typo if you did. Your enum: > public Enum SearchListL*_oac_*ation > { > Up,Down > > } > > -- > breitak67 |
My System Specs![]() |
![]() |
| Thread Tools | |
| |