Thursday, 20 May 2010

ELMAH - Error Logging Plugin for your .Net Apps

Error Logging Modules and Handlers (ELMAH)

ELMAH (Error Logging Modules and Handlers) is an application-wide error logging facility that is completely pluggable. It can be dynamically added to a running ASP.NET web application, or even all ASP.NET web applications on a machine, without any need for re-compilation or re-deployment. ELMAH supports ASP.NET 1.x, ASP.NET 2.0 and ASP.NET 3.5 applications and ships with a variety of log source providers like XML or database.

Few of its features are –
• Logging of nearly all un-handled exceptions.
• A web page to remotely view the entire list of recoded exceptions and
then view the full details of any one logged exception.
• In many cases, you can review the original yellow screen of death
that ASP.NET generated for a given exception, even with customErrors
mode turned off.
• An e-mail notification of each error at the time it occurs and an
RSS feed of the last 15 errors from the log.
• Log errors to several back-end storages like Microsoft SQL Server,
Oracle (OracleErrorLog), XML files, etc.
• Filter unwanted exceptions, programmatically and via configuration.
• Use MsAjaxDeltaErrorLogModule to log errors during partial updates
enabled by Update Panel in Microsoft ASP.NET AJAX.

Usage -
ELMAH can be used in all APS.Net web applications which run on .Net framework 1.x, 2.0 and 3.5.

Source
Open-source/Developed/Customized

Advantage
1. Helps in debugging/resolving production deployed application issues
well within support SLA time frame.
2. Ability to view detailed application exceptions remotely, thus reduces
our turnaround time in responding to customer queries.
3. Its free, open-source and highly customizable.
4. Easy to implement in existing projects.
5. Instant notification to support and maintenance team about
application issues via email or RSS feeds.


Why choose ELMAH -
ELMAH provides a low cost, easily and quickly deployable, application-wide error logging facility which provides the maintenance and support teams with in-depth exception information required while debugging and resolving production application issues.

Link -

Wednesday, 19 May 2010

Tips and Tricks - Visual Studio IDE

VS 2008 keyboard shortcuts -
http://nerdfortress.s3.amazonaws.com/visual-studio-2008-keyboard-shortcuts.html

Tips for navigating to a class definition -
If you want to go to a definition for a class, variable etc, u will need to point at the variable and press the F12 button to navigate to its definition.
Also, if you want to find out all the properties for a class ( .net class) , Eg: - Page

You will need to type the fully qualified name - Eg:- System.Web.UI.Page

Now the URL can be typed as
http://msdn2.microsoft.com/System.Web.UI.Page.aspx

Some useful links for .Net developers

101 LINQ Examples -
http://msdn.microsoft.com/en-us/vcsharp/aa336746.aspx

Nice Q and A sessions can be found in
http://stackoverflow.com/

WCF tutorials -
http://www.wcftutorial.net/

WPF Tutorials -
http://www.wpftutorial.net/

RJS Calendar Control -
http://code.msdn.microsoft.com/RJSPopCalendar/


Please let me know for any updates

Tuesday, 18 May 2010

Tools and Utilities

Tools and utilities-

Here is a list of tools and utilities that can be used to enhance productivity.

I have classified them into Developer Tools and Common Tools. And what’s more – They are free to use without any license tags attached.

Developer Tools –

1. SQLDBx – One of the most useful utilities from a database perspective. Can support both SQL 2000 and 2005 versions from Microsoft. Has an option to connect to Oracle and Sybase servers as well. Also, have options like intellisense and maintaining SQL History. Has various context menu options for exporting results to Excel, generating scripts for insert, update and delete for a particular row or set of rows affected. The free, personal edition can be downloaded form the below link:-

http://www.sqldbx.com/personal_edition.htm

2. FireBug – Nice add-on for Firefox which can be used for debugging, editing monitoring HTML rendering, JavaScript and CSS of any site. Also, has support for DOM as well. The alternative to this in IE is the Internet Developer tools (available with only IE 8). Can be downloaded from the following link.

https://addons.mozilla.org/en-US/firefox/addon/1843/


3. XML Notepad 2007- A free utility to create XML files through easy user inputs. No need to manually create XML tags. Link : http://www.microsoft.com/downloads/details.aspx?familyid=72D6AA49-787D-4118-BA5F-4F30FE913628&displaylang=en

4. Notepad++ - A free utility or editor which has support for multi languages in notepad version itself. Allows multiple tabs as well. Other alternative most popularly used is EditPlus.

http://notepad-plus.sourceforge.net/uk/download.php

5. 7 -zip - A installable for all your zipping needs !
No need for Winzip, Winrar and compatibility issues.
http://www.7-zip.org/


Common Tools –

1. Free Commander – A tool which is useful for tabbed navigation in Windows Explorer. Can be downloaded from the below link. You could also navigate easily by clicking on the root link or on the address menu after customizing your settings.



2. Screen Toaster - Screen Toaster is a free web-based screen recorder designed to capture screen activity in real-time to rapidly create and share tutorials, demos, training, lectures and more.

  1. To watch videos : Just click on a video to launch the player.
  2. To record videos : Click on "Start recording" or "Record", start recording using the shortcuts or via the recorder.

You can add audio and an embed webcam while you are recording.
When finished, add subtitles, choose your thumbnail, describe and tag your video so other users can easily find your screencasts.








Microsoft VDM -- virtual desktop manger

Microsoft process explorer -- enhanced process explorer

widom-soft screen hunter -- screen grabber

stickies -- digital post-it

Microsoft time zone -- multiple timezone



Friday, 29 January 2010

Paging Sorting and Filtering using J Query, J-SON and C#

We all have known that the Visual Studio IDE has the Grid View control that gives us inbuilt methods and capabilities to do the customized paging, sorting and filtering of data.


Now, the disadvantages:-

1. Navigation – We would have to write our own custom based procedures or methods to fetch only the required records if we implement paging. Also, we would have to implement the update panel and /or update progress available with AJAX toolkit to give a nice navigation progress feel to the user.

2. Time for Search Results – The time delay for the user would be more, since there are overheads that would be involved by using the GridView control and also more overheads if any row data bound events are written on them. Any other events attached to the page would result in further delay to display the results

3. Page size- Usually higher and complex controls also would be used for any such feature which requires any other person to have atleast a fair bit of understanding on how the page works.

Enter J-Query, where this can be used in all your applications and which is more performance oriented. The need to navigate, page and search records according to a particular search criteria is much simpler and faster.

Before letting you know all the details, please visit the following sites –

Introduction to JSON


For introduction to J-Query:

J-templates


JSON Plugin


So, I will now compare the conventional method v/s the J-query way of writing code.


Taking the example of a cascading drop down effect to be achieved,


Normal style:-

Have 2 dropdowns and have a selected index changed event for the first dropdown and get the selected value of the first dropdown, and then populate the second dropdown by calling a method from your business logic. The better approach would be to use the Cascading dropdown provided by AJAX control toolkit.

Sample code shown below:-

AJAX reference in the page:-

Drop down code-




AJAX Cascading drop down reference written-






















Also, there would be a web service which would fetch relevant records. The web service code can be found from the sample reference link below:-

Reference for AJAX Cascading drop down.

J–Query method –
Download the latest version of J - Query from the J-Query home page and reference that in your page-
Then you would have an inline code of java script or an external file, which does the cascading effect without any hassles. Also, no other references are required on the page, thus making it lightweight and performance oriented.

Page reference to the script -

Drop down HTML –




Document ready code in external JS for the page –




Dropdown change event triggered in J-query –




Manipulating 2nd dropdown values inside the change event for 1st dropdown -



Calling web method in J Query–