Wednesday, 28 January 2009

Asp.Net to PDF export

Interesting article on exporting a GridView to PDF:

 

http://csharpdotnetfreak.blogspot.com/2008/12/export-gridview-to-pdf-using-itextsharp.html

 

Uses open-source project iTextSharp

Friday, 16 January 2009

Asp.Net encrypt connection string in web config

Quick note on how to encrypt the Connection string in the web.config for future reference
Encrypt the Connection string :
aspnet_regiis -pef "ConnectionString" "c:\path\to\website"

Grant Access to IIS to the key
aspnet_regiis -pa "NetFrameworkConfigurationKey" "NT Authority\Network Service"

note aspnet_regiis is in the .net framework directory for the version of .net that you are using

Wednesday, 15 October 2008

Rhino mocks - partial mock calling real method not mocked expectation

Had a few occasions where a Partial mock was calling the real method even though an expectation had been defined.

The reason was that the method being called was not marked as Virtual and so not being overridden by the mock repository.

Thursday, 25 September 2008

Encrypt / Decrypt Web.Config sections

See article here to encrypt or decrypt section of web.config file.

Thursday, 18 September 2008

VS2005 XML Comments not shown

XML Method comments are not being displayed by intellisense for methods of classes other than those in the same project.

Any referenced DLL must have the XML file which contains the comments in the same directory as the DLL itself.

Tuesday, 16 September 2008

Asp.Net - Simulate a windows service

Very interesting article here: CodeProject:AspNetService detailing how to simulate a windows service running completely within Aps.Net using cache item call backs.