0

Modify a Word 2007 Open XML document via C#

Posted by Tim on April 20, 2009 in .NET Framework, C#

Interesting problem that I came across here…A client requested that their system was to have the ability to load in a Word 2007 Document, perform some text manipulation routines and save the document back to the server. Firstly, you can rename a docx document to docx.zip and you can extract all of the files in [...]

Tags: , ,

 
0

A CMS that integrates into ASP.NET MVC

Posted by Tim on April 13, 2009 in .NET Framework, ASP.NET, C#, Open Source

Here is a open source CMS called N2 that provides a CMS framework to build web applications on using the ASP.NET MVC Model.   Its a very basic CMS, but it provides all the core functionality including Pages, Articles and a .NET Permissions Model (it also has some add ons and allows developers to contribute their [...]

Tags: ,

 
0

Decoupled Code using SubSonic

Posted by Tim on March 18, 2009 in C#, Open Source

Subsonic is fantastic when generating a bunch of classes directly from the database structure…but the issue comes when OO/Application Objects clash with relational database structures.   An idea is to use Subsonic to query the data from the database and map the data directly to a application/OO object. A really good example following the link below [...]

Tags:

 
0

Best Coding Practices – TIP 3

Posted by Tim on February 20, 2009 in .NET Framework, C#

The use of partial classes can help improve coding for the following reasons: As you can split code into seperate physical files, its easier to seperate UI and Business Logic that may belong in a single class Produces clean and organised code No performance hit… The compiler groups all partial classes into one entity during [...]

Tags: ,

 
0

Using ContextMenuStrip and NotifyIcon classes with WPF

Posted by Tim on February 10, 2009 in .NET Framework, C#

There are many ways to get a notification icon displaying in the system tray, this is how I managed to get it working using Windows Presentation Framework: public partial class ClassName : Window { private System.Windows.Forms.NotifyIcon m_notifyIcon; private System.Windows.Forms.ContextMenuStrip m_contextMenu; public ClassName() { InitializeComponent(); //Initalize the context menu strip m_contextMenu = new System.Windows.Forms.ContextMenuStrip(); System.Windows.Forms.ToolStripMenuItem mI1 [...]

Tags: ,

 
0

Action(T) Generic Delegate

Posted by Tim on January 19, 2009 in C#

Very useful delegate to create anonymous functions…why? This is especially useful when you have repeated code within a function. This particular example gets a list of tables from a database based on a key that is consumed by the id parameter. The Action(T) delegate can have zero to several different parameter types. Action getTables(String id) [...]

Tags: ,

 
0

Using the HttpWebRequest class

Posted by Tim on January 14, 2009 in ASP.NET, C#

In this particular scenario I had to initiate a request from another website in code and track its response to be modified and rendered back to the user. I had a series of LinkButton html controls on the web form that consume one event. <asp:LinkButton id=”link1” runat=”server” onClick=”genericEvent”></asp:LinkButton> When the user clicks on a particular [...]

Tags:

 
0

Using ASP.NET MVC on IIS6 or below

Posted by Tim on January 13, 2009 in .NET Framework, ASP.NET, C#

When you are building a web applicatio using the ASP.NET MVC framework on IIS7, it URL routing works smoothly and without any dramas.   But when it comes to IIS6 you have to make a comprimse especially if you are developing web apps within a shared hosting envoirnment.   I found the easist way is to change [...]

Tags: , ,

 
0

Creating a generic list of anonymous types

Posted by Tim on October 4, 2008 in .NET Framework, ASP.NET, C#

Scenerio I have a simple HTML form on a ASP.NET Web page. This form is to post a number of values including several elements that are compulsory to perform several actions on the server. As we know, when we post values to ASP.NET these are available for Request.Form. All we know is the key and [...]

Tags: , , , ,

 
0

Using Nested Functions in C#

Posted by Tim on September 7, 2008 in .NET Framework, C#

Scenario We currently have a templating API system where this allows developers to use a combination of C# and HTML markup to customized the display of the client’s websites. In this case, I needed a way to quickly perform some calculations and formatting without having to declare the function at design-time. My problem was I [...]

Tags: ,

Copyright © 2008-2012 Codelab Blog All rights reserved.
Desk Mess Mirrored version 1.9.1 theme from BuyNowShop.com.