February 2012
1 post
1 tag
Column to Column SQL copy
Funny enough, I couldn’t find this snippet of sql code online. I needed to copy a column within the same table to another.
Feb 2nd
January 2012
5 posts
1 tag
Get IP Address in C#
Here is a little snippet of code I use in ASP.NET to get a client’s IP Address, handy to have this info if you web application is designed for certain countries or regions.
Jan 31st
1 tag
Remote Desktop not allowed to use saved... →
I was having this annoying error with remote desktop credentials not being saved at work. This little tutorial fixed the issue, worth a read if your having this problem.
Jan 26th
1 tag
SQL & Distinct Results
If you are working through a large list of potentially similar entries for maybe a cascading dropdown for manual location entry then you might find the DISTINCT sql command quite valuable. This query returned 3800+ counties with tons of double entries: Add in our special DISTINCT keyword and we get just 91 unique counties:
Jan 11th
11 notes
2 tags
How to Increase Message Size Quota
Sometimes when dealing with web services that return large amounts of data you get the follow error message. The maximum message size quota for incoming messages (65536) has been exceeded. To increase the quota, use the MaxReceivedMessageSize property on the appropriate binding element. This can be fixed by increasing the maxReceivedMessageSize, maxBufferSize, maxBufferPoolSize, maxArrayLength...
Jan 10th
2 notes
1 tag
Tumblr Custom Theme Recovery →
For a second there I thought I had just undone all my custom theme work on my blog by previewing a theme that really did wipe out my html code. Thankfully Tumblr have a theme history set up. Use the link supplied and you can view the last 20 code changes you have made to your theme and revert back to the state of any of them. Phew!
Jan 3rd
December 2011
1 post
1 tag
Quoteme.ie Car Insurance Facebook App
This iFrame Facebook application takes all the questions needed to complete a car insurance quote on the website Quoteme.ie. When the user clicks on the Start A Quote Now button a window will pop up with the real quote system all pre filled in for the user. View the application.
Dec 1st
November 2011
8 posts
2 tags
Bundling and Minification in ASP.NET 4.5 →
Great overview of the new bundling & minification options in ASP.NET 4.5
Nov 29th
12 notes
1 tag
Nov 29th
1 tag
Nov 29th
2 tags
ASP.NET Response.Redirect to new window →
Bit a life saver, works great for iFrame apps on Facebook if you need the user to engage with a full screen web app outside of Facebook’s width limitations.
Nov 24th
2 tags
Local Machine DNS Control For Better Testing
When setting up a new website or web application it is advisable to make sure your new creation is working properly on the server it will live on remotely. This is made easy by simply setting up your server but not creating the public DNS entry for the website and only setting the DNS settings up on your own PC so you can test away. This is done by editing the hosts file...
Nov 18th
21 notes
2 tags
Remove .aspx from Umbraco URLs
You probably noticed, as did I that when you enable clean urls in umbraco that you can still access your pages using the .aspx extension. This is pretty bad for SEO as Google will see identical copies of each page, thus duplicate content as far as the bots will be concerned. To solve this you can go into the UrlRewriting.config file in your umbraco installation and drop in the code below, make...
Nov 11th
6 notes
2 tags
Change Umbraco from email for Contour
This one is well hidden within Umbraco for some reason and is not adjustable with Contour from what I can see. If you want your emails to show as something other than your@email.here then you will need to go into config/umbracoSettings.config. You should find this in that file around line 30. <notifications>             <email>your@email.here</email> ...
Nov 3rd
12 notes
2 tags
Content dependent markup in Umbraco using Razor
With Razor being so easy to use in Umbraco now, I thought I might try out a simple if statement to hide markup that wraps around non mandatory content. Took a couple of attempts but it was fairly easy to do and works well. <umbraco:Macro runat=”server” language=”cshtml”>             @if (@Model.aboutMeImage.ToString() != string.Empty)             {        ...
Nov 2nd
15 notes
October 2011
5 posts
2 tags
Fancybox & ASP.NET Web Forms
There was a nasty little problem I came across with Fancybox that really tested my patience before I noticed what the problem was. If you pop open a modal window with a contact form in it, you will notice that your form won’t submit with ASP.NET web forms. No js errors, nothing at all. You press your button, the page won’t reload and your modal box stays open. Fortunately I...
Oct 18th
3 tags
Oct 17th
2 tags
Using reCAPTCHA with ASP.NET →
Very simple bit of code to get running in the above link. The only thing about the dll Google supply is you must have MVC installed on your system, use the web platform installer if you haven’t got it. Also Google show the code in VB! Below is the reCAPTCHA control check code in CSharp for btnSubmit. protected void btnSubmit_Click(object sender, EventArgs e)     {         if...
Oct 11th
2 tags
Umbraco Contour & Razor Bug
A quick note for something that has cost me considerable time working out. If you are using Umbraco’s contact form package Contour and you insert a contact form into your page via a richtext box editor. Make sure in your template you are not using a Razor macro to insert the content of your richtext box, use the normal XSLT method. Your form won’t show otherwise. So don’t do...
Oct 10th
36 notes
1 tag
Razor DynamicNode Cheat Sheet →
A great cheat sheet for using Razor in Umbraco 4.7.1
Oct 3rd
September 2011
2 posts
1 tag
Build an Umbraco powered website from start to...
Lately I have been doing a lot of specific development work, back in February I had been getting familiar with the basics of Umbraco but it had to be sidelined for 6-7 months. However a couple of website builds are upon me now and I need to quickly get up to speed with taking a static website (html/css/js) and having it powered by Umbraco with contact forms. There is a new tutorial series on...
Sep 12th
2 tags
Simple 301 Redirects ASP.NET 4.0 in Code
Sometimes it is just easier to code in 301 redirects into an application that you are building. Specially if it is replacing a system on the same domain. I had this recently with https://carquote.quoteline.ie. It is very easy to use your Global.asax file to program in 301 redirects without having to use IIS when using ASP.NET 4.0. void Application_BeginRequest(object sender, EventArgs e)    ...
Sep 12th
August 2011
6 posts
2 tags
http://base64decode.org/ →
A very handy website to encode & decode BASE64 strings. Always nice to know what is in the viewstate of your web form application.
Aug 30th
11 notes
1 tag
IE9 Compatibility Mode
Easy to forget this tag but it comes in handy if IE9 is not playing nice with older designs. <meta http-equiv=”X-UA-Compatible” content=”IE=EmulateIE8” > Just drop that in below the title & other meta tags in your header section and it will force IE8 rendering mode in IE9.
Aug 23rd
11 notes
1 tag
Web Development Project: Motor Quotation System
Features: This system was built using ASP.NET Web Forms, it uses the Relay web services for broker quotation of products and integration with their back end for staff using the Relay desktop client. - Broker Software Integration (Relay Web Services) - Email Storage (Mailchimp Services) - Full Payment/Direct Debit Processing (Realex Services) - Text messaging service for client sales (Esendex...
Aug 10th
2 tags
ASP.NET Data Scraping
Something that has been annoying me for a while on a hobby website is the process of maintaining a points table of F1 drivers. Recently I thought there had to be a way to pull the drivers standings from the official website; there was. Using the WebClient class, String functions and some Regex I was able to pull down the drivers standings from the official website… nice! Here is the code, very...
Aug 7th
1 note
2 tags
How to maintain a .gif animation after a page...
So, this has been quite a difficult thing to do, so many sources online are either outdated or only address the IE problem and not Firefox. So here is a very simple, easy & reliable way to make a gif animation continue animating on a pleasewait page. Please note, I use jQuery in this example. PleaseWait.html - The redirect page that will show the gif via another page using an iframe tag....
Aug 5th
1 note
2 tags
ASP.NET’s HttpHandler to bridge the cross-domain... →
An absolutely brilliant article on ASP.NET & JSON from Dave Ward. If you are an ASP.NET dude you should watch this guys blog and follow him on twitter. He knows his stuff!
Aug 3rd
July 2011
5 posts
1 tag
Looking for the new ConfigurationManager in... →
Much like this guy I was wondering why the hell I was getting a warning pulling in an app.config variable. http://weblogs.asp.net/scottcate/archive/2005/06/13/Looking-for-the-new-ConfigurationManager_3F00_.aspx
Jul 26th
7 notes
2 tags
IIS Crypto, PCI compliance software for... →
Got a PCI compliance test coming up? Make sure you are not using weak Cryptographic Algorithms, this little piece of software will disable old & weak protocols for you. https://www.nartac.com/Products/IISCrypto/Default.aspx
Jul 25th
4 tags
Simple encrypting & decrypting of strings in...
Using the link I posted earlier about encrypting & decrypting data in C#, here is the code for a simple ASP.NET web site that uses the encryption/decryption explained on a string. .aspx file <%@ Page Language=”C#” AutoEventWireup=”true” CodeFile=”Default.aspx.cs” Inherits=”_Default” %> <!DOCTYPE html PUBLIC “-//W3C//DTD XHTML...
Jul 14th
48 notes
3 tags
Simple encrypting and decrypting data in C# →
A super simple CSharp example of encryption/decryption of a string, well worth reading.
Jul 14th
34 notes
2 tags
Disable buttons when performing an Ajax.NET...
Recently I have been having trouble with a new system that went live a few weeks ago with users getting impatient with ajax postbacks and deciding that spamming the buttons will make things go faster… Needless to say I was getting lots of exceptions in my elmah log. =( However over on Encosia.com Dave Ward has got a pretty awesome server control called PostBack Ritalin that will disable...
Jul 5th
June 2011
3 posts
1 tag
ASP.NET Viewstate Decrypter
Came across this handy website that allows one to see what is in the Base64 encrypted viewstate of an ASP.NET webform. Fairly interesting what you find in there! ;) http://ignatu.co.uk/ViewStateDecoder.aspx
Jun 20th
3 tags
Regex SQL Injection Protection in CSharp
I have been working with some private web services for the last few months and the project based around them is finally coming together. However the last thing I am looking into is SQL Injection, the web services wrap around a database and I have nothing to do with the formatting of the SQL so what do I do? Well I check to make sure with the developers of the web services to ensure that they do...
Jun 16th
1 note
1 tag
To support IE6 or not?
If ( your site does not make money ) {    do what makes you happy } else if ( the cost of supporting IE6 > the money you make from IE6 users ) {    stop supporting IE6 } else {    keep making money from IE6 users }
Jun 11th
May 2011
4 posts
1 tag
CheckBox Enable/Disable Button Control
Some super handy validation controls put together by Scot Mitchell fill the validation void in ASP.NET Web Forms for checkbox & checkbox list controls. However he expanded on these controls to allow for easy enable/disable functionality for a button triggered by a checkbox. This sort of functionality is quite common with systems that require you to accept the terms and conditions before...
May 17th
1 tag
Expand & Collapse regions in all Visual Studio...
One of my favourite features of working with the Visual Studio Express Editions for ASP.NET and Windows Phone is regions in the code behind files. #region my region int string = “awesome”; #endregion And then you can hide the code within the region and expand the region when you need to review the code. However these can build up and while you might like that since your region...
May 11th
1 note
2 tags
Accessing Session State from App_Code folder
Adding functionality to your ASP.NET web pages from your App_Code folder is probably my favourite feature of ASP.NET Web Forms, however you might have noticed that you cannot not access session state from your .cs files as easily as you might from a code behind file. Thankfully it is quite easy to get a hold of current session state data from your application. Add in this using statement to your...
May 9th
2 tags
Sorting custom objects in CSharp
Recently I had to figure out a way to sort a large amount of data coming back from a web service call that I had put into a List of custom objects to store the returned data individually. Turned out there is a Sort() method for Lists in CSharp that has the power to dig into lists and sort your data, even for custom objects. So, in my case I had a custom object called TheQuote which stored data...
May 5th
April 2011
3 posts
1 tag
SQL Server Error Log Management
If you are in control of a website that has considerable traffic you have no doubt found that MS SQL Server will eat into hard drive space with it’s error log file. Basically this file contains log information on the activity of SQL Server instance. However it can grow to a fairly large size and it is advisable to move it from you live server to some sort of backup. You can’t just...
Apr 11th
17 notes
1 tag
Simple RSS Reader in ASP.NET
What you see more and more is basic websites integrating a their blog (usually contained on a subdomain blog.yoursite.com) into their websites. What can seem like an easy task though of pulling in RSS feeds can actually get fairly messy. However a lovely chap called Dmitry Robsman created an RSS datasource control that you can use to bind RSS feed data to controls in ASP.NET. Import the custom...
Apr 4th
1 tag
Wifi Hotspots with Windows 7
For some reason all you see online at the moment is Windows 7 wifi hotspot related topics making you use software like connectify or use the command line to share your internet connection. However it is very straight forward to do and you can use Windows 7’s Network and Sharing center, avoiding any command line messing and random software installing. Here are two articles that show you...
Apr 1st
1 note
March 2011
6 posts
2 tags
ASP.NET Viewstate to bottom of page.
Something that bugs me from time to time is the base64 encoded viewstate in the source code. It might be worth your while moving it to the bottom of the page. There are mixed opinions online in regards to whether or not having your viewstate at the top of the page has an effect on Google/Bing rankings. It is a hidden element so spiders should ignore it, but do they? Let’s be safe rather...
Mar 29th
1 tag
Changing the ASP.NET Target Framework in Visual...
A very handy feature most people don’t know about with Visual Web Developer 2010 Express is that you can change the target framework from .NET 4.0 to 3.5, 3.0 or 2.0. By default Visual Web Developer 2010 will be set to .NET Framwork 4.0 but if you are in a situation where you have one server, possibly Windows Server 2003 that runs on .NET 3.5 and another server, possibly Windows Server 2008...
Mar 28th
1 note
1 tag
ASP.NET Button Commands
Something that I unbelievably didn’t know was that you can send specific commands and arguments via specific buttons in ASP.NET. Say you have a button control on a page that has an associated onclick method called myMethod. <asp:Button ID=”myButton” Text=”My Button” onclick=”myMethod” /> And you want your method to process many different buttons...
Mar 22nd
1 note
1 tag
Clearing ASP.NET Session Data
The current project I am working on has me making a good bit of use of Session variables. One thing that I was not sure about was how to delete specific session variables or even maybe clear out all session data. Thankfully this is quite easy. =D Create session data and then removing it: (aDrvier is a wrapper class of basic driver details containing strings, datetimes and ints.) ...
Mar 18th
2 tags
ASP.NET String.Insert()
A super handy way to modify strings is the Insert() method. It comes in very handy when you are binding looped data to web controls with a populate method. string yourString = “1000”; string yourEuroString = yourString.Insert(0, “€”); Now you can use yourString as the value parameter for a dropdown and yourEuroString as the text parameter. Resource: dotnetperls.com
Mar 8th
3 notes
1 tag
Quotation Engine Design Screens
All the development work aside, I recently put together the main question set design for a motor quotation engine I am building at the moment and also the results of that quotation. I always find putting the screens together help you see and notice features you may have overlooked. These are only first draft designs but the data contained within in them is final. First is the question set...
Mar 2nd
February 2011
8 posts
3 tags
XML Sitemaps in Umbraco
Something that I always look for in a CMS is a dynamic sitemap… you know the xml document that shows search bots all the pages of your website? Here have a look at this one: http://umbraco.com/sitemapxml To have a sitemap like this for your website is vital if you want to rank well. You should specifiy the location of your sitemap in your robots.txt file, have a look at...
Feb 24th
1 note