<?xml version="1.0" encoding="UTF-8"?>
 		<rss version="2.0"><channel>
 		<title><![CDATA[WiredWorx || Web design || SEO || Bournemouth]]></title>
 		<description><![CDATA[Articles]]></description>
 		<link>http://blog.wiredworx.co.uk/</link>
 		<copyright><![CDATA[Copyright WiredWorx || Web design || SEO || Bournemouth]]></copyright>
 		<generator>sNews CMS</generator><item>
			<title><![CDATA[Use CSS to stop iPhone / iPad from enlarging text ]]></title>
			<description>
				<![CDATA[
				After doing some site updates for a client the other day and all was well except for a report that when rendering the site on an iPad / iPhone some of the text in some areas was a great deal larger than it should be. This lead to hours of investigations as to why this may be, trawling through the CSS which was blatantly correct (as it was very simple) all of which came to a dead end. It turns out in the end that it was these devices being 'helpful' and rendering the font size to be larger, I assume for ease of reading. Anyhow we didn't want this functionality and so implemented the following css against the body:
<br /><br />
body<br />
{<br />
-webkit-text-size-adjust: none;<br />
}<br />
<br />

This did the trick and the site behaved as expected!<br />
<br />

				]]>
			</description>
			<pubDate>Wed, 25 Jan 2012 00:46:43 +0000</pubDate>
			<link>http://blog.wiredworx.co.uk/website-and-seo/use-css-to-stop-iphone-ipad-from-enlarging-text-/</link>
			<guid>http://blog.wiredworx.co.uk/website-and-seo/use-css-to-stop-iphone-ipad-from-enlarging-text-/</guid>
			</item><item>
			<title><![CDATA[Exporting to an excel file from ASP.NET MVC]]></title>
			<description>
				<![CDATA[
				I was intrigued about how to create an excel file from a datasource the other day as ASP.NET MVC obviously is very different from web forms. In web forms there are a hundred and one ways to do this, the easiest we found was to use a plug in such as ASPOSE which then allows you easily to export to a .xls file.<br /><br /> 
After a bit of searching the t'interweb I stumbled upon this <a href="http://www.billsternberger.net/asp-net-mvc/export-to-excel-or-csv-from-asp-net-mvc-with-c/" title="">great article from Bill SternBerger</a>. I have also copied and pasted it in below as I'm worried that his blog hasn't been updated for over a year and so it may just disappear one day!<br /><br />
<i>
<p>Since programming way back in the Classic ASP days, at some point a client always wants to export an html grid into an Excel grid. In c#, that need didn&#8217;t disappear, but got a lot easier with GridView and the HtmlTextWriter. Finally reached that point in my ASP.NET MVC programming world, and quite frankly, am surprised it took this long, for this same need! But I digress. To pull this off, all we are really going to do is add an export method to a controller, most of which will look very familiar to asp.net web forms.</p> 
<h2>Add using statements</h2> 
<p>using System.Web.UI;<br /> 
using System.Web.UI.WebControls;<br /> 
using System.IO;</p> 
<p>We are going to use our dear old friend the GridView from web forms as a placeholder for our data, which is why we need the second using statement.</p> 
<h2>Create Controller Method</h2> 
<p>This one is pretty easy, consisting of three parts:</p> 
<ul> 
<li>Creating the GridView placeholder</li> 
<li>Binding the query results to the GridView placeholder</li> 
<li>Dumping the results back to the browser</li> 
</ul> 
<p>This example queries all contacts that have not unsubscribed, but you can imagine how easy it is to extend.<br /> 
var contacts = Contact.FindAll();<br /> 
var grid = new System.Web.UI.WebControls.GridView();</p> 
<p>grid.DataSource = from contact in contacts<br /> 
where contact.Unsubscribe == false<br /> 
select new<br /> 
{<br /> 
ContactID = contact.ID,<br /> 
FullName = contact.FullName,<br /> 
Email = contact.Email<br /> 
};<br /> 
grid.DataBind();</p> 
<p>Response.ClearContent();<br /> 
Response.AddHeader("content-disposition", "attachment; filename=YourFileName.xls");<br /> 
Response.ContentType = "application/excel";<br /> 
StringWriter sw = new StringWriter();<br /> 
HtmlTextWriter htw = new HtmlTextWriter(sw);<br /> 
grid.RenderControl(htw);<br /> 
Response.Write(sw.ToString());<br /> 
Response.End();</p> 
<p>That&#8217;s it!</p> 
 
</i>
				]]>
			</description>
			<pubDate>Thu, 17 Feb 2011 16:40:49 +0000</pubDate>
			<link>http://blog.wiredworx.co.uk/website-and-seo/c-tutorials-and-tips-visual-studio/exporting-to-an-excel-file-from-asp-net-mvc/</link>
			<guid>http://blog.wiredworx.co.uk/website-and-seo/c-tutorials-and-tips-visual-studio/exporting-to-an-excel-file-from-asp-net-mvc/</guid>
			</item><item>
			<title><![CDATA[How to structure TFS folders - MSDN]]></title>
			<description>
				<![CDATA[
				Starting out on a new project is daunting especially when working as a team and having so much to set up. If you are using TFS (Team Foundation Server) for source control, to make life a little easier follow <a href="http://msdn.microsoft.com/en-us/library/bb668992.aspx" title="">these instructions from Microsoft</a> on how  best to get your folders set up.<br /><br />Aside from making the structure easy to navigate there are also huge benefits in that continuous integration and automated builds  and branching and merging will be much easier. <br /><br />
				]]>
			</description>
			<pubDate>Tue, 15 Feb 2011 13:35:38 +0000</pubDate>
			<link>http://blog.wiredworx.co.uk/website-and-seo/how-to-structure-tfs-folders-msdn/</link>
			<guid>http://blog.wiredworx.co.uk/website-and-seo/how-to-structure-tfs-folders-msdn/</guid>
			</item><item>
			<title><![CDATA[Differences between Scrum and XP]]></title>
			<description>
				<![CDATA[
				I have never been a stickler to stick to rules and this is also true of agile adoption. A lot of people who think they know a lot about agile practices like to get SCRUM certified and then follow a SCRUM methodology down to the most minute detail. One thing that I have always learned though is that no two organisations are the same and when trying to apply a generic pattern to multiple organisations it doesn't always work - think of it as the same as off the shelf software... It's kind of what you want, but to get the most out of it it will have to be customised to some extent. <br /><br />
I was very happy when I read <a href="http://allankelly.blogspot.com/2011/01/scrum-technical-practices-xp.html" title="">Allan's blog</a> regarding the matter which hinted that the best way to go was <a href="http://en.wikipedia.org/wiki/Scrum_(development)" title="">SCRUM</a> for governance but to incorporate <a href="http://en.wikipedia.org/wiki/Extreme_Programming" title="">XP</a> technical aspects to be the most productive (pair programming, TDD, BDD, continuous integration etc)... Which it just so happens is what we've been doing for the last few years!<br /><br />
				]]>
			</description>
			<pubDate>Tue, 15 Feb 2011 11:03:43 +0000</pubDate>
			<link>http://blog.wiredworx.co.uk/website-and-seo/differences-between-scrum-and-xp-agile/</link>
			<guid>http://blog.wiredworx.co.uk/website-and-seo/differences-between-scrum-and-xp-agile/</guid>
			</item><item>
			<title><![CDATA[Create a mock session in ASP.NET MVC using Rhino Mocks]]></title>
			<description>
				<![CDATA[
				<img src="images/mock_session.jpg" alt="screenshot of a mock session" /><br />
<br />
Firstly we will introduce a few of the objects:<br />
<strong>_testRepository</strong>
 => is a repository which implements the same interface as the controller we are putting to test.<br />
<strong>_controller</strong>
r => is the controller we are testing, which has an over-ridden constructor passing in the _testRepository.<br />
<strong>_mockRepository</strong>
 => is a Rhino.Mocks class to create the mock data which we will be using.<br /><br />
The process is then fairly simple (although took about a day's worth of work to figure out!)<br /> The first block of code is used to create the HttpSessionStateBase object and then create a stub which in effect is the mocked session variable and value. <br /><br />
The second block is where we create the HttpContextBase object, as the session needs to live in the context this step is necessary. There are also other elements of the context which may be mocked as well (such as request, response etc) but for this example we're not worried about them. We then set it so that when a session is requested from the calling code, the object will return the session mock that we just created.<br /><br />
The third block of code was what baffled me for a while! I am still not 100% sure what it is doing, but it seems that in order for these objects to be accessible to calling code they must be set into a 'Replay' state.<br /><br />
Finally we set the ControllerContext of our controller to be the mock context we have just set up... Et voila, the session variables that are set up are now accessible from the unit tests!<br /><br />

				]]>
			</description>
			<pubDate>Fri, 11 Feb 2011 12:22:15 +0000</pubDate>
			<link>http://blog.wiredworx.co.uk/website-and-seo/c-tutorials-and-tips-visual-studio/mock-session-in-asp-net-mvc-using-rhino-mocks-HttpSessionStateBase/</link>
			<guid>http://blog.wiredworx.co.uk/website-and-seo/c-tutorials-and-tips-visual-studio/mock-session-in-asp-net-mvc-using-rhino-mocks-HttpSessionStateBase/</guid>
			</item></channel></rss>
