Monday, May 24, 2010

Configure Support for Unhandled Exceptions in WCF services

"By default, WCF services do not return information from unhandled exceptions to protect sensitive data. Exception data contains low-level information about the implementation of a service that can be used by attackers to compromise a Web service. During development, it is often necessary to view this information to troubleshoot issues with the service. As a result, WCF provides the ability to configure a service to return information from unhandled exceptions."
 

Wednesday, May 5, 2010

Capturing mouse position with JavaScript

I had an issue today where I needed to capture the (x, y) coordinates of the user's mouse when they clicked on various links in a grid. The original code was using the clientX and clientY event properties to determine the coordinates, which seemed to work well; however, when the grid contained several more rows of data the page required scrolling and the clientX and clientY values were no longer relative to the position of the page.
 
Google had quite  few articles on the topic, but the one I ended up finding the most useful was:
 
 
The code I ended up using in my scenario was:

// determine x,y coordinates of mouse position relative to document
var clientX = 0;
var clientY = 0;

if (!e) var e = window.event;
   
if (e.pageX || e.pageY) {
   clientX = e.pageX;
   clientY = e.pageY;
}
else if (e.clientX || e.clientY) {
   clientX = e.clientX + document.body.scrollLeft + document.documentElement.scrollLeft;
   clientY = e.clientY + document.body.scrollTop + document.documentElement.scrollTop;
}

Tuesday, May 4, 2010

Configure SQL Server Agent Mail to Use Database Mail

I had an issue this morning when email notifications were not working for a SQL Server Agent Job. I found this entry in the error logs:
 
[264] An attempt was made to send an email when no email session has been established
 
A quick Google search led me to this article:
 
 
To set up SQL Server Agent Mail to use Database Mail
  1. In Object Explorer, expand a server.

  2. Right-click SQL Server Agent, and then click Properties.

  3. Click Alert System.

  4. Select Enable Mail Profile.

  5. In the Mail system list, select Database Mail.

  6. In the Mail profile list, select a mail profile for Database Mail.

  7. Restart SQL Server Agent.

Following these steps and configuring the mail profile accordingly allowed me to be able to successfully send the email notifications.

Monday, May 3, 2010

Outlook 2007 Favorite Folders disappeared

I ran into an issue today where someone's Outlook 2007 lost the Favorite Folders in the navigation pane.
 
The obvious place to go to try showing it again was View - Navigation Pane but to my surprise Favorite Folders was no longer listed.
 
After some digging around on Google I came across this article, which lead me to a solution that worked for this particular situation (Outlook 2007, Windows 7).
 
 
Specifically what action I took was:
 
- Close Outlook
- Go to the command prompt
- Browse to C:\Program Files\Microsoft Office\Office12
- Execute OUTLOOK.EXE /resetnavpane
- Open Outlook
- Go to View - Navigation Pane and check Favorite Folders
 
Here's a a good website that describes the available command line switches for Outlook.
 

jQuery UI

"jQuery UI provides a comprehensive set of core interaction plugins, UI widgets and visual effects that use a jQuery-style, event-driven architecture and a focus on web standards, accessiblity, flexible styling, and user-friendly design."


"ThemeRoller allows you to design custom jQuery UI themes for tight integration in your projects. To create a custom theme, select the Roll your own tab and tweak the settings. As you work, the UI components to the right will update to reflect your design and you can download your theme whenever you like."

jQuery Flyout Menu

Here's a website showing how to incorporate a jQuery flyout menu into your website.

http://www.filamentgroup.com/lab/jquery_ipod_style_and_flyout_menus/

It doesn't look like it's still actively being maintained by this group, but I still thought it was worth bookmarking in order to follow its progress.