James Flower

.NET Developer working on the web and cloud

Fixed/Sticky Headers on ASP.NET GridView using jQuery

Posted on
2 min read

The GridView control in ASP.NET Web Forms is an extremely useful and quick way of getting data out to the user in a nice tabular format. It does have one weak spot though and that is some of the tags it uses when doing this. Specifically, not putting the header information inside a <thead> tag. So why is this important? When you have a LOT of rows (as some do) after you’ve scrolled down the page and the table headers are out of view you can forget which column is which, especially i

Read more...

Sending e-mails through Office 365

Posted on
5 min read

I recently signed up for an Office 365 Business Essentials subscription to get the benefit of Exchange and other nice features without the hassle of managing it myself, as part of this I wanted to setup a no-reply e-mail address I could use to send automated e-mails without having to fork out extra for another user. The answer I found lies in using a shared mailbox for the e-mail address and preventing it from accepting incoming e-mails, then configuring the client to use Office 365 as an SMT

Read more...

Strongly Typed Data in ASP .NET Web Forms

Posted on
3 min read

In ASP .NET Web Forms you’ve previously had to use strings to specify which properties you’d like to output when databinding, which would probably end up looking something like the following. <asp:templatefield headertext="Last Name"> <itemtemplate> <asp:literal runat="server" text="<%#: Eval("LastName") %>"> </asp:literal></itemtemplate> </asp:templatefield> In all likelihood it could probably look far less tidy if you’ve ever needed to do any formatting on values y

Read more...

Install WPScan on Ubuntu 13.10

Posted on
2 min read

Prerequisites Since Ubuntu 13.10 doesn’t come set up for development work out of the box there are a few things you need to download and install first. Thankfully this is made easy by apt-get by just running the following command to get everything ready. sudo apt-get install libcurl4-gnutls-dev libopenssl-ruby libxml2 libxml2-dev libxslt1-dev ruby-dev build-essential git Setting up WPScan First off we need to clone the git repository to get the code for WPScan. We can do

Read more...

Send E-mail through Microsoft Exchange using .NET

Posted on
2 min read

Recently I needed to send an e-mail using Microsoft Exchange Server from an ASP .NET Web App. My first attempt involved using the classes in the System.Net.Mail namespace however I quickly realised this wasn’t the way to be going about it as I had very little luck getting a connection to the server. After a while spent with Google I realised that there were some web services which could be used to perform tasks, these were called Exchange Web Services (EWS) and thankfully Microsoft provide a m

Read more...

Using a RequiredFieldValidator on a DropDownList in ASP .NET

Posted on
2 min read

In most applications today drop-down lists default to a “Please select..” option with some form of validation to ensure the user makes their own selection. In ASP .NET web forms this frequently results in a drop-down list being created using code similar to that displayed below. <asp:DropDownList ID="ddlOptions" AppendDataBoundItems="true" runat="server"> <asp:ListItem Text="Please select an option..." Value="-1" /> </asp:DropDownList> We can add an ASP .NET RequiredFie

Read more...

Boot Camp Support Software

Posted on
1 min read

After upgrading a Boot Camp Windows 7 installation to Windows 8 I found that the Boot Camp drivers needed to be updating to regain control of the function keys and built-in camera. The Boot Camp software is available at Apple Boot Camp Support Website. After the download I found the installer failed to run with the error “The installer encountered errors before Boot Camp could be configured“. It turns of some programs interfere with the Boot Camp installer, especially ones rela

Read more...

How to allow HTML content in ASP .NET MVC

Posted on
1 min read

Sometimes in web development, you need to provide an easy-to-use editor for non-technical users to input or change content where extra styling is required such as making text bold or italic. However unless you use (or code yourself) an editor which uses some form of BBCode you’re going to come across the following error message if you’re using ASP .NET. I have seen various “fixes” to this suggested, the most frequent being turning off request validation entirely. While this will

Read more...

ASP .NET AJAX Control Toolkit Reorder List control and LINQ

Posted on
2 min read

The ASP .NET AJAX Toolkit is quite a useful and yet under-used set of controls. However they can also quickly lead to bizarre issues and worse performance than normal if they are not properly understood or used correctly. This issue is compounded when you take into consideration that quite a few of the controls included have a number of fairly unique bugs in them. An instance of this is in the Reorder List control which is intended to allow a user to re-order a list of items by simple dr

Read more...