NuGets of gold

“NuGet is a Visual Studio extension that makes it easy to add, remove, and update libraries and tools in Visual Studio projects that use the .NET Framework.” http://docs.nuget.org/ To be as agile as possible, the projects developed by the team tend to be coded as separate .Net projects, rather than within one over-arching framework. This makes it easy, when starting a project, to copy the elements from the most similar existing project and just get on with it, without worrying about breaking existing applications. The downside to this is that bugs that are identified and fixed in one project may also need to be fixed in many other projects. In the same way, design changes (updates to templates) need to be rolled out across many sites. Updates to libraries such as jQuery or .Net need to be rolled out across many sites too but there can be an advantage in that, as testing can be done in smaller chunks before the new version can go live – plus the rule of, if it ain’t broke, don’t fix it, can be applied to the older projects that don’t have any other reason to be updated. ...

January 16, 2014 · 4 min

Frameworks for Rich Internet Applications

Reading to do relating to frameworks for Rich Internet Applications… Visual Studio 2013 bundles Knockout.js, which looks fairly straightforward (I hope) Postal could be a better way of handling the events https://github.com/postaljs/postal.js Need to make sure our applications are accessible: http://stackoverflow.com/questions/7370056/accessibility-and-all-these-javascript-frameworks With Knockout, you can pass the server side model to the client like this: <script> ko.applyBindings(@Html.ToJSON(Model)); </script> Comparison of frameworks http://blog.stevensanderson.com/2012/08/01/rich-javascript-applications-the-seven-frameworks-throne-of-js-2012/ Yet more from the developers at Twitter http://twitter.github.io/hogan.js/. This is a compiler for {{mustache}}, which is a templating language that can convert JSON to HTML in a similar way to Razor converting entities to HTML in ASP.Net. Useful if you want to say generate whole data grids on the client. If your server is getting JSON from elsewhere and you want to template it into HTML, you can use mustache templates on the server (rather than client) using https://github.com/jdiamond/Nustache ...

January 13, 2014 · 1 min

Entity Framework – Model First

There are 3 ways to link entity framework to a database: Database first. Point Visual Studio at your database and it will create an entity model for you. Code first. Write your classes in Visual Studio and it can create your database for you. Model first. Use the Entity Data Model Tool in Visual Studio to model your entities. Visual Studio will can them create your database and classes for you. I’ve just tried Model First and not achieved what I wanted. ...

January 9, 2014 · 2 min

HTML emails

If you need to dynamically create HTML emails (say for a new announcements system), the first thing to do is question whether you really need to or if any other alternative will do. This is especially the case if you’re going to give users a WYSIWYG editor to create marked up content. Some useful resources: http://webdesign.tutsplus.com/tutorials/htmlcss-tutorials/say-hello-to-the-html-email-boilerplate/ http://24ways.org/2009/rock-solid-html-emails/ http://htmlemailboilerplate.com/ https://litmus.com/blog/16-tips-troubleshooting-html-email https://templates.campaignmonitor.com/build/ http://www.campaignmonitor.com/css/ http://premailer.dialect.ca/ – converts CSS to inline styles https://litmus.com/email-testing – get screenshots of your email in different clients

September 4, 2013 · 1 min

Convert URLs to hyperlinks in Excel using VBA

Public Sub Convert_To_Hyperlinks() Dim Cell As Range For Each Cell In Intersect(Selection, ActiveSheet.UsedRange) If Cell <> "" Then ActiveSheet.Hyperlinks.Add Cell, Cell.Value End If Next End Sub

September 21, 2012 · 1 min

Linked servers in SQL Server

Querying across databases using linked servers should be easy: http://stackoverflow.com/questions/4091960/sql-server-linked-server-example-query but linking SQL Server 2008 (64 bit) to SQL Server 2000 (SP3 I think) results in an error: Cannot obtain the schema rowset “DBSCHEMA_TABLES_INFO” for OLE DB provider “SQLNCLI10” for linked server… To get around this the old server needs a stored procedure as follows: create procedure dbo.sp_tables_info_rowset_64 @table_name sysname, @table_schema sysname = null, @table_type nvarchar(255) = null as declare @Result int set @Result = 0 exec @Result = sp_tables_info_rowset @table_name, @table_schema, @table_type go as described here: ...

May 29, 2012 · 1 min

Status code 301 “moved permanently” in ASP.Net

Response.StatusCode = 301 Response.Redirect("http:////www.NewLocation.com") ''' doesn’t result in a status code of 301, so do it this way: ```C# Response.Status = "301 Moved Permanently"; Response.AddHeader("Location","http:////www.NewLocation.com"); Response.End(); thanks to: http://www.vikramlakhotia.com/Search_Engine_Web_World_and_301_redirect.aspx In ASP.Net 4 you can use Response.RedirectPermanent() In ASP the code would be: <%@ Language=VBScript %> <% Response.Clear Response.Status=”301 Moved Permanently” Response.AddHeader “Location”,”http://www.address\_to\_redirect\_to/” %>

March 21, 2012 · 1 min

The weirdest IE6 CSS bug – The multiple class bug

As described here: http://paulirish.com/2008/the-two-css-selector-bugs-in-ie6/ if you write #tooltip.red { background: white; color: red; } #tooltip.yellow { background: black; color: red; } the second rule will be ignored

March 13, 2012 · 1 min

naming conventions for custom stored procedures to be used in netTiers

Quoting from http://www.31a2ba2a-b718-11dc-8314-0800200c9a66.com/2008_03_01_archive.html “If you create your own procs, prefix those procs to something that you won’t confuse with any other library’s procs, such as ‘cust’ for custom. Of cource, IncludeCustoms is set to true and CustomProcedureStartsWith should be set to ‘cust_{0}_’ so that a table name of Profile should have a custom proc of cust_Profile_SelectAll.” if you set CustomProcedureStartsWith to just ‘cust_’ as we have done in the past, a method is created for each stored procedure for each table, whereas using ‘cust_{0}_’ only creates one method for each stored procedure – that method is linked to the table its name is based on. Far more sensible.

February 23, 2012 · 1 min

Calling LoadLibraryEx on ISAPI filter “C:WindowsMicrosoft.NETFrameworkv4.0.30319spnet_filter.dll” failed

If your website produces this error, Rick Strahl has the answer: http://www.west-wind.com/weblog/posts/2011/Apr/04/Error-on-64-Bit-Install-of-IIS-LoadLibraryEx-failed-on-aspnetfilterdll

February 3, 2012 · 1 min