Geeks With Blogs

Tim Huffam Dotting the I and crossing the T of I.T. April 2006 Entries
text-align: center; not working in Firefox
I have the following scenario: .container{ text-align: center; border: solid 1px blue;}<div class=container><tabl... In IE (6) this displays as you would expect (with the table centered). However with Firefox (1.5) the table is left aligned. Apparently this is due to a bug with the way FF handles CSS. The workaround is to use this: text-align: -moz-center;instead of text-align: center; Don't ask me why "-moz-center" ......

Posted On Wednesday, April 19, 2006 7:28 PM

Error (m_safeCertContext is an invalid handle.) when accessing a client certificate using .NET 2.0/VS2005
This error (m_safeCertContext is an invalid handle.) occurs when you try to access a client cert (or a member of the cert) from a ASP.NET 2.0 application developed using VS2005 eg: X509Certificate cert = new X509Certificate(Request.Cli... certSerial = cert.GetSerialNumberString(); The error is thrown because no valid certificate is found. This can be caused by either: A problem with the cert. A common reason for this in a development environment is one of the cert properties ......

Posted On Tuesday, April 18, 2006 1:58 PM

CSS nowrap alternative
To achieve the same results as a TD nowrap (<td nowrap="true">) using cascading style sheets, use the following: white-space: nowrap; This style attribute only applies at the TD element level ie needs to be applied to each TD, ie not the the TR or TBODY. If you're desparate to not apply it to each TD, then you can get away with only applying it to the TD's of the first row - but this is only effective if applied to the cells containing thelongest data (so IMHO is a half-baked approach - ie ......

Posted On Sunday, April 16, 2006 4:48 PM

Log4Net - writing to windows event log with ASP.NET
I found that there were a couple of things required to get this working - over and above the samples shown here. To initialize Log4Net and to tell it to load it's configuration from the web.config file add the following line to the Application_Start method within Global.aspx: log4net.Config.XmlConfigura... To make sure all unhandled exceptions are logged add the following line to the Application_Error method within Global.aspx: Log.Fatal("An uncaught exception occurred", this.Server.GetLastError())... ......

Posted On Thursday, April 13, 2006 7:48 AM

Converting an integer to hexidecimal using C#.Net

This is done using the String.Format method.  You can use both positive or negative decimal values (that must of course be integers) eg:

int decimalValue = -12345;
Console.WriteLine (String.Format("{0:x2}", decimalValue));


Posted On Tuesday, April 11, 2006 11:33 AM

Copyright © Tim Huffam | Powered by: