Posts

Showing posts from December, 2011

Dynamically Creating Image in C#.Net

              As per the requirement from one of my client, an image should be generated dynamically by taking the necessary information from the user.  When I went on a search, I came to know that, my crazy DotNet framework provided my two namespaces System.Drawing and System.Drawing.Imaging.  It’s enough to learn three classes from these namespaces - Bitmap and Graphics for generating an image dynamically related to System.Drawing Namespace and FileFormat class is for saving the created image in different file formats and is related to System.Drawing.Imaging Namespace.             Bitmap class is useful to generate a new image and to save it different file formats.  Graphics class is useful to design the image using lines, curves, rectangles, text etc., with colors and everything.  FileFormat class is useful to save the file in a particular or in different formats like Jpeg, Png, Bmp etc.  The default format is png.                         Now lets jump into code.  After

Custom Error Pages In ASP.NET

Image
* Errors And Exceptions In ASP.NET - covers different kinds of errors, try-catch blocks, introduces Exception object, throwing an exception and page_error procedure. * Application Level Error Handling in ASP.NET - goes a level higher and explains handling of unhandled errors by using Application_Error procedure in Global.asax file, using of custom Http modules, sending notification e-mail to administrator, show different error pages based on roles and logging errors to text files, database or EventLog. This tutorial deals with user experience when error occurs. When error is occurred on ASP.NET web application, user will get default error page (which is not so nice looking, also known as "Yellow screen of death"). This error page confuses average visitor who don't know the meaning of "Runtime Error". Although developers like to know many details about an error, it is better to show more friendly error page to your users.           Web.config file c