Solved

Custom properties don't show at design time?

Posted on 2008-10-18
5
288 Views
Last Modified: 2013-11-26
I am building a website in ASP.NET, and I use WebUserControls heavily. Most of the webusercontrols have custom properties, declared public in the code-behind. Some of hte properties are bindable, some aren't, all of them are public.

How come only SOME of the time I can see those properties in design-mode in Visual Studio? I can always set them in the source code, but sometimes they won't show in the properties window, and sometimes they will. And sometimes, only a couple of them show and a third one isn't there.
0
Comment
Question by:Frosty555
  • 3
  • 2
5 Comments
 
LVL 4

Accepted Solution

by:
AhmedHindy earned 500 total points
Comment Utility
i think you have to give the property the suitable attribute like <Browsable(True)> _
0
 
LVL 4

Expert Comment

by:AhmedHindy
Comment Utility
i think you have to give the property the suitable attribute like
 <Browsable(True)> _
OR
[Browsable(true)]
0
 
LVL 31

Author Comment

by:Frosty555
Comment Utility
I didn't realize you had to explicitely specify. I've put that into some of my properties now.

But... it's still not working. And it was JUST working for this control! I built the webusercontrol, put the properties in, looked at it in another page - everything was visible from design mode - ran the project, and now when I go back.... it's gone! And it won't come back. These properties DO specify the  Browsable attribute.

... man what the heck is going on here?
0
 
LVL 31

Author Comment

by:Frosty555
Comment Utility
Ooh, it just came back. I added a fifth parameter and now suddenly all parameters are visible from design view. Screenshot attached (note - the webusercontrol looks like a hyperlink but it's actually a webusercontrol with a hyperlink inside of it)

But the properties don't show on my other web user controls. This is very strange.
prop1.jpg
0
 
LVL 31

Author Comment

by:Frosty555
Comment Utility
Okay, after playing with it a bit, I think your suggestion was correct. Perhaps I just needed to restart ASP.NET.

It seems the custom properties disappear if I go into the code directly and add attributes to the tags myself. Maybe when you custom edit it like that you lose the ability to see it in design mode.
0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

A quick way to get a menu to work on our website, is using the Menu control and assign it to a web.sitemap using SiteMapDataSource. Example of web.sitemap file: (CODE) Sample code to add to the page menu: (CODE) Running the application, we wi…
Wouldn’t it be nice if you could test whether an element is contained in an array by using a Contains method just like the one available on List objects? Wouldn’t it be good if you could write code like this? (CODE) In .NET 3.5, this is possible…
It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
This tutorial demonstrates a quick way of adding group price to multiple Magento products.

728 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now