8. June 2011 by Mads

By default the <asp:Label /> control in ASP.NET render as a <span> HTMl tag. That can be kind of a problem if you have some CSS that only applies to an <label> tag. So, how do you make a <asp:label /> render as a <label> tag?

Actually it's pretty easy. All you need to to is to set the "AssociatedControlID" on the <asp:Label /> to an associated text. The reason for this is that you usually use a label as the caption for a textbox, as it is the nature of the HTML <label> tag.

 

11. September 2010 by Mads

Yesterday I were working on a ASP.NET project and needed to add a new Web User Control. I right clicked the project and went to Add New Item. I looked for the Web User Control, but couldn’t find it. I looked again, I asked a co-working, I search for “web” and “user control” and nothing were found.

I then started googling for the problem and found a simple post that told me exactly how to fix this.

Close all your instances of Visual Studio.
Open Visual Studio Command Prompt.
image

Type in the following and hit Enter.
devenv /installvstemplates
Wait for this to complete.
When it’s done, open VS2010 again and you should now have all your control templates again.

Happy coding!

14. February 2010 by Mads

When you have a web site, for instance an installation of BlogEngine, you often want to be able to know about errors on it and if it is down. There are a lot of tools to help you out here, but in this post I will talk about using a build-in ASP.NET feature called Health Monitoring and a tool I wrote called WebMonitor.

More...

2. February 2010 by Mads

So today it happened, finally, the new version of BlogEngine has been released. It comes with some major Comment Spam Protection changes, multi widget support and more. This is all great and I really hope that this can beat these bad comment spam bots, which I guess we all hate.

I have just upgraded my blog to this latest release and the upgrade went pretty good without any real problems. So far so good, now I just have to wait and see if the spam protection is working as intended.

More...

22. September 2009 by Mads

Yes sorry, this isn’t Silverlight related at all, but it’s still nice to know, so I thought I would share.

I am currently doing a website that uses a “fancy” menu with a lot of jQuery. It were all working fine, until I added Lightbox2. Well, the product it self is working fine and is actually very nice, but when used together with jQuery, at least the combination of the versions I were using of both, it causes problems – “Error: 'null' is null or not an object”.

To make a long story short, I found the problem. A script that comes from the lightbox2 overwrites the jQuery “$” sign, which isn’t good and makes this error appear. Luckily there is a very easy fix for this.

Replace “$()” with “jQuery()” – and now your running again, at least I were. Hope this helps you too.

- Enjoy!