473,398 Members | 2,113 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,398 software developers and data experts.

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}:SearchLi st 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,
Aug 17 '08 #1
4 1023
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
Aug 18 '08 #2
On Aug 18, 9:46*am, Marc Gravell <marc.grav...@gmail.comwrote:
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.
Aug 18 '08 #3

Did you cut and paste the code? There is a typo if you did. Your enum:
public Enum SearchListL*_oac_*ation
{
Up,Down
}
--
breitak67
Aug 19 '08 #4
On Aug 19, 3:47*am, breitak67 <gu...@unknown-email.comwrote:
Did you cut and paste the code? There is a typo if you did. Your enum:
public Enum SearchListL*_oac_*ation
{
Up,Down

}

--
breitak67
no i re-typed it from another computer (closed network)
Aug 31 '08 #5

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

Similar topics

5
by: John Smith | last post by:
I have a custom enum to list comparison operators: =, <, <=, >, >= . I have created it as follows: public enum Comparator {Equal, LessThan, LessThanOrEqual,GreaterThan,GreaterThanOrEqual} Now...
21
by: Andreas Huber | last post by:
Hi there Spending half an hour searching through the archive I haven't found a rationale for the following behavior. using System; // note the missing Flags attribute enum Color {
3
by: Alan | last post by:
Hi, is it possible to create a project that can offer different members of a Public Enum according to a condition ? I mean, Project A has a public enum. Project B & C access A's enum. However B...
18
by: **Developer** | last post by:
If e.Button = MouseButtons.Left Then also from a Dim Answer As DialogResult = MessageBox.Show.. Select Case Answer Case DialogResult.Yes
1
by: PT | last post by:
Hi, I'm creating a library of basic constol that I often use, and am just getting to the whole custom process, I've started by creating something simple by inheriting from a textbox, I have two...
2
by: Jigar.Patel | last post by:
Hi, I have following enum definition. public enum OperationTypes { All = 1, New = 2, View = 4,
34
by: Steven Nagy | last post by:
So I was needing some extra power from my enums and implemented the typesafe enum pattern. And it got me to thinking... why should I EVER use standard enums? There's now a nice little code...
1
by: shapper | last post by:
Hello, I have a custom control property named "ImagePosition". I need to have only two options available for this property: "Left" and "Top". How can I do this? Thanks, Miguel
14
by: =?Utf-8?B?UHVjY2E=?= | last post by:
Hi, I'm using VS2005 and .net 2.0. I'm creating an application that has 3 forms. I want allow users to move forward and backward with the forms and retain the data users have entered. I thought...
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: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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?
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.