iPhone Web Site Dev in Visual Studio
Posted in .Net-Development by Matthew Clements on 16 Jun, 2010
If you are developing an ASP.Net web application that is to be consumed by an iPhone (or other mobile device) you'll find it a bit inconvenient that the built in web server with Visual Studio can't be accessed on anything other than localhost or 127.0.0.1 - but not for long...
I just read (and followed) the post by Erich Eichinger here and patched my Visual Studio WebServer to allow me to connect to my development environment from my iPhone on WiFi
What is even better is that you can debug in Visual Studio whilst navigating the application on the iPhone!
Well done that man!
If you want any help doing this - you know where I am
An great article on JQuery and .Net for us Microsoft People
Posted in .Net-Development by Matthew Clements on 07 Sep, 2009
I stumbled across the following article on the use of JQuery and .Net - really helped bring a little focus to the benefits of JQuery in what we do and I can see that we will be making good use of it over the coming weeks!
http://dotnetslackers.com/articles/ajax/Using-jQuery-with-ASP-NET.aspx
asp.net and the W3C validator
Posted in .Net-Development by Matthew Clements on 30 Jul, 2009
Validation of XHTML and CSS is of growing importance for both cross-browser compatibility of code as well as accessibility and semantic understanding of your website.
ASP.Net scuppers these attempts by needing 2 pieces of configuration in order to make it valid AND allow the W3C validator to recognise the fact
Firstly the following lines are needed in your web.config:
<system.web>
<!-- other elements here -->
<xhtmlConformance
mode="Legacy" />
</system.web>
Available options are "Legacy", "Transitional" and "Strict": take your pick..
Adding this to your web.config WILL make the output rendered to the browser XHTML compliant - however the level of this is goverened by how the browser identifies itself to the IIS web server, with 'older' or 'unrecognised' browsers it doesn't bother to transform the output.
Unfortunately the W3 validator (http://validator.w3.org/) isn't recoginsed by IIS as an XHTML compatible browser so it outputs at best Transitional content.
To fix this add an "App_Browsers" folder to your solution ("Add ASP.Net Folder" from the contect menu on the project in VS.Net) and create a file called "WhateverYouLike.browser" with the following content:
<browsers>
<browser id="w3cValidator" parentID="default">
<identification>
<userAgent match="^W3C_Validator" />
</identification>
<capture>
<userAgent match="^W3C_Validator/(?'version'(?'major'\d+)(?'minor'\.\d+)\w*).*" />
</capture>
<capabilities>
<capability name="browser" value="w3cValidator" />
<capability name="majorversion" value="${major}" />
<capability name="minorversion" value="${minor}" />
<capability name="version" value="${version}" />
<capability name="w3cdomversion" value="1.0" />
<capability name="xml" value="true" />
<capability name="tagWriter" value="System.Web.UI.HtmlTextWriter" />
</capabilities>
</browser>
</browsers>
deploy this to your server and you'll have a much better chance of achieving XHTML Strict code through .Net
Hope it helps!

