Category Archives: asp.net

HTML rounded corners without images and div nesting

Yesterday I had troubles to get an ASP.NET control to work with rounded corners in various browsers. IE and Firefox operate slightly different from each other, and to get it working (using ASP.NET themes) was quite a pain in the ass. Besides, it is not cool to have the obligation to change 4 images per control every time the design team has the bright idea to change website colors for some very good reason.

Luckily, at the end of the day, I discovered DD_roundies, a Javascript library perfectly taking care of my needs. Only in Opera this functionality does not function as wanted (no rounded corners), but that’s an issue Drew Diller is trying to address, according to his website. I definitely would suggest you to try for yourself if you would like an acceptable solution to the problem described hereabove.

The only thing that does not currently stop bothering me: unfortunately it is (still) not possible to have some javascript in an ASP.NET theme. Would that be possible, the solution would be perfect (for me). Perhaps somebody found a solution for me :P ?

Cheap ASP.NET web hosting

Since a couple of months I moved my hosting packages to a new host, DIGITALiBiz. The reason I moved in to them is their incredible low pricing considering what they offer. I currently have ASP.NET 3.5 hosting, 350GB disk space and 5 SQL Server 2005 databases of 250MB each. Who can beat them???

After some months of working with DIGITALiBiz, I can say that they have an excellent support team and a very reasonable performance. Definitely recommended!

Curious? Have a look at DIGITALiBiz.

Technorati tags:

ASP.NET: DefaultButton and DefaultFocus

Since a while, on some of my company’s internet pages the DefaultButton and DefaultFocus properties did not work, although the code used seemed to be perfect. The problem was that the DefaultFocus javascript was not rendered at all.

After investigating the problem, I walked into two problems, solving which solved my problem as well:

1. DefaultButton requires a control’s UniqueID property, but DefaultFocus requires a control’s ClientID property. Strange, but it really works :) !
2. Do not use hyphen characters in your ID properties (I had an auto ID using a GUID), since it will cause your focus to fail (the javascript is not being rendered). If you have or want to use some kind of separation, use the underscore character instead (it will work).

Hope that helps somebody out there too ;) !

Technorati tags:

Set MasterPage (.master) title from a web form (.aspx)

Lots of people complain about not being able to change the master page’s title using ASP.NET 2.0 and up. A commonly seen tutorial is to use the following piece of code:

((HtmlTitle) Page.Master.FindControl("lblTitle")).Text =
    "Set some kind of title";

In most of the cases you need to change the master page’s title, you do not have to bother about this. Just use the correct page stadium and set the page’s title. The only page event to be able to do this is Page_PreInit (since master page and content page are still separate ‘pages’ in this stadium). The following will work (if you have AutoEventWireup enabled ;) ):

protected void Page_PreInit(object sender, EventArgs e)
{
    Title = "Set some kind of title";
}