Archive

Archive for the ‘Programming’ Category

Web Developer Cheat Sheets

March 20th, 2009

JQuery.UI Dialog with ASP.NET empty post values

March 20th, 2009

Ran into an issue using a jQuery.UI.Dialog control on an asp.net web form today.  When defining a dialog jQuery.UI takes the dialog and appends it right before the closing </body> tag.  This is outside of the <form> tag causing any values you wanted from the form to be empty in your code-behind.

Here is the fix that worked for me:

$('#dialog').parent().appendTo('/html/body/form[0]');


This works great and the dialog now displays as expected, capturing the results in the code behind except for I originally wanted the dialog wrapped in a UpdatePanel. In order to fix this issue, I created an empty div and appended the dialog content there:

$('#dialog').parent().appendTo('#dialog_target');


Not the results i expected. When the content refreshes the dialog is messed up. The answer was to move the content panel inside of the dialog with the user control doing all the work!!!

<div id="dialog" class="ui-widget-content ui-corner-all" title="Add New Client"></div>

Programming, codeproject , , ,

Source Code Outliner Power Toy

February 25th, 2009

This is one of my favorite plug-ins for Visual Studio.  In my opinion it works better than the Alpha drop down at the top of the window.  For those of you that organize your source code this tool will be perfect.

http://www.codeplex.com/SourceCodeOutliner

Programming ,

Out-of-memory exception in Visual Studio

February 24th, 2009

There is a limit in 32-bit windows to only use up to 2GB of RAM. This site lists a hack to fix it both in the boot.ini (XP) and also in Visual Studio, although I haven’t been successful with the /LARGEADDRESSAWARE command yet.

http://stevenharman.net/blog/archive/2008/04/29/hacking-visual-studio-to-use-more-than-2gigabytes-of-memory.aspx

Programming, Tips and Tricks , ,

Property Manager AddIn for private members

February 20th, 2009

Ya, i know, you can type “prop” + tab->tab but i like this better. It will create the public properties for a highlighted list of private members to the clipboard. You can then choose where to paste the results in your code.

For a complete description:
http://www.csharper.net/blog/property_manager_addin_for_visual_studio_2005.aspx

To download the VS 2008 Compatible version:
http://www.csharper.net/blog/visual_studio_2008_add_in_compatibility.aspx

Programming ,

Scrum Default Template Changes

December 11th, 2008

Found this article written by an acquaintance on a few changes to the scrum default templates for Visual Studio.  I find it a little easier than the default values.

http://crazedcodemonkey.blogspot.com/2008/12/comfortably-scrum-my-common-product.html

Programming ,

Plugin based development in .NET

December 9th, 2008

Found a brief, useful example of how to implement a simple plug-in based application via .NET today on CodeProject.

http://www.codeproject.com/KB/gadgets/pluginmanager.aspx

Programming ,

Configuration Section Designer

December 9th, 2008

“A Visual Studio add-in that allows you to graphically design .NET Configuration Sections and automatically generates all the required code and a schema definition (XSD) for them.”

http://www.codeplex.com/csd

Programming ,

Sending and receiving JSON messages from a WCF Service

August 27th, 2008

Here is a sample project which will show you how to send and receive JSON data from a WCF service using three of the most popular javascript libraries.  You can do it without the libraries but why reinvent the wheel.  Also, this is actually a VS2008 Studio Template so just download and drop the file into My Documents\Visual Studio 2008\Templates\ProjectTemplates\Visual C#\ and enjoy.

To use the template, goto File\New Project\Visual C# and look to “My Templates” and you should see WCF JSON.

wcf-json Visual Studio 2008 Template

Programming , , ,

WCF and Large File Transfers

August 22nd, 2008

I’ve been doing a bit of WCF lately and picked up on a few things that will be helpful for me to remember.  To speed large transfers switch the messageEncoding on the binding to be MTOM, otherwise your data will get base64 encoded inside the XML.

  1. Streaming requires a MessageContract and not a DataContract
  2. Streaming doesn’t work on wsHTTPbinding.
  3. A MessageContract can only have one Member in the body (stream).

Another good piece:
http://www.aspfree.com/c/a/Windows-Scripting/WCF-and-Hosting/3/

Programming , , ,