Link to home
Start Free TrialLog in
Avatar of Frosty555
Frosty555Flag for Canada

asked on

Custom properties don't show at design time?

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.
ASKER CERTIFIED SOLUTION
Avatar of AhmedHindy
AhmedHindy
Flag of Egypt image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
i think you have to give the property the suitable attribute like
 <Browsable(True)> _
OR
[Browsable(true)]
Avatar of Frosty555

ASKER

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?
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
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.