Intellisense for Properties on ASP.NET Custom Server Controls

NOTE:  The solution described below is only necessary if your web page and custom control are in the same project.

I had this really not fun time this week blowing a couple of hours on something that should have been zero impact so I thought I’d share here.  I wrote a custom ASP.NET server control and then added to an ASPX page with the Register tag, and then added a tag for my control.  I then went to set one of the properties of the control in the attributes of the control tag in the ASPX, the way everyone is used to doing.  The really frustrating thing is that it wasn’t showing any of my custom properties.  After messing around with it for a couple of hours and getting no where, I finally realized that I had to close Visual Studio 2010 completely, then reopen it to see the properties I had added.  Yes, don’t be confused when looking at the calendar, it really is 2010.

So to get custom properties to show up in the ASPX Intellisense you need to:

  • Use properties that are Read / Write
  • Recompile your control and register in the GAC or place in the BIN of your ASP.NET app
  • Close Visual Studio
  • Reopen Visual Studio
  • Junk starts working

Hope this saves someone some time.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s