Posts

Showing posts from September, 2008

Fixed Datagrid Headers

Quick and dirty way to make Datagrid Headers stay at the top of the page while your viewers are scrolling down the page can be accomplished with a little CSS   Add this style:       .DataGridFixedHeader { POSITION : relative ;  TOP : expression(this.offsetParent.scrollTop) ; BACKGROUND-COLOR : white } Add this to your Datagrid properties:       HeaderStyle-CssClass =" DataGridFixedHeader " And Voila ... you have a header that stays in place.

Errors Errors Errors

We would always prefer to avoid all errors but if one happens we certainly want to know about it. Adding an error handler to the Global.asax file is slick - easy and works beautifully..... here is what you need: Sub Application_Error( ByVal sender As Object , ByVal e As EventArgs) Try Dim strFrom As String = System.Configuration.ConfigurationManager.AppSettings( "EmailFrom" ) Dim strTo As String = System.Configuration.ConfigurationManager.AppSettings( "EmailTo" ) Dim msg As System.Net.Mail.MailMessage Dim smtp As New System.Net.Mail.SmtpClient( " mail.yourmailserver.com " ) msg = New System.Net.Mail.MailMessage(strFrom, strTo, "Page Error My Application Name" , BuildMessage()) msg.IsBodyHtml = True smtp.Credentials = New System.Net.NetworkCredential( "Username" , "password" , " mail.myserver.com " ) smtp.Send(msg) Catch ex As Exception End Try End Sub The buildMessage Function in the global.asax