Posts

Showing posts from August 2, 2009

Convert Word-Documents to PDF on an ASP.NET Server

Image
Introduction This PDFConverter converts Microsoft Word documents ( *.doc ) into PDF-files on a Webserver. There is a simple Webform, where you can upload your Word-Document, which will be converted and sent back as a PDF-File. Prerequisites Microsoft Word 2007 2007 Microsoft Office Add-in: Microsoft Save as PDF or XPS A User, who has the rights to execute Word, must be logged in on the Server The PDFconverter.exe must be running (part of this project) Background There are a lot of people trying to do this Word => PDF conversion using Com Interop directly from their ASP.NET code. As Microsoft reports , Word or any other Office products are not recommended to be automated on a server. The Office products are optimized for running as client applications using a Desktop for interaction. This is why, if you want to use an Office-product in any kind on a server, there must be a User logged in. But then, there is the next problem: Using COM Interop directly from ASP.NE

ASP.NET Providers for the ADO.NET Entity Framework

Image
Introduction One of the most powerful improvements of ASP.NET 2.0 was truly the introduction of the membership, role and profile providers. They allow to rapidly integrate user management, role based security as well as visitor based page customization into your ASP.NET application. The name already indicates that they all implement the provider model design pattern. Unfortunately, Microsoft doesn't have these providers ready to download leveraging the ADO.NET Entity Framework. The downloadable source from this article provides a ready-to-use implementation for the above mentioned providers. The following article gives a quick overview about providers and it describes what it takes to get the provided source up and running. In order to understand the source, sound knowledge of LINQ is inevitable. Furthermore, it is important that readers understand the philosophy behind ASP.NET providers. The following link gives a good overview of the ASP.NET providers. Background

A Custom UpdateProgress Control

Image
Introduction In this article, I’d like to show you how to build a custom update progress control with the following aspects: The whole page will be protected by other requests caused by clicking on the buttons located on a page. The progress bar will be displayed The button for aborting the process will be available. The control doesn’t need to have a specified UpdatePanel . It will work for each UpdatePanel located on a page by default. The update progress control will be available from JavaScript as an object. It means you can use it either for an UpdatePanel or for custom AJAX requests. For understanding this article, you should know what is the UpdatePanel control and finally what is the UpdateProgress control. Let’s have a look at the following screenshot to find out what the result will be: Pic 1 As you can see, there is the yellow box approximately in the middle of the page. The rest of the page is covered by shadow and does not allow the users to clic

A custom DecimalBox for accepting only Digits and a Decimal Point

Introduction In a recent project I was creating for evaluating investment properties I found I was going to need as many as 20 or so text boxes to accept monetary amounts, the purchase price, down payment, taxes, rental income, miscellaneous income, and a number of expenses beyond just the mortgage payment. I initially searched the web for examples of a control that would only accept digits, but was disappointed with what I found; likewise when I considered formatting the user input as currency. The solutions I encountered didn't do anything to ensure that the user couldn't make a mistake that wasn't caught and immediately rejected by the code, and the formatting examples I found were inspirational, but not quite what I wanted to accomplish. So, I decided that I would use pieces of what I'd found to create a custom cotrol that did exactly what I wanted it to do. The criteria were as follows: Any character other than a digit or a single decimal point was to

Making a parsable text box in .Net 3.5

Image
Introduction The standard WPF controls provided by the .Net 3.5 SP1 framework do not contain a range of controls like numerical text boxes. Very often developers need these text boxes to limit the user input to accept integers or floating point etc. I developed these controls while working on a hobby project of mine. While at it, I thought it would be nice to extend these controls to beyond numerical data types and in general, parse any text into strongly typed .Net objects. This article describes how to extend the library to target any .Net data type that you want to create ,starting from plain text input. Note: Unless and until mentioned otherwise, we will referring to input that has to be parsed as a System. Double object. We will call its text counterpart as floating point representation. Background The objective is to get textboxes that accept a text input that can be parsed into a strongly typed .Net object. Now, most people will enter text character by characte