 <?xml-stylesheet type="text/css" href="https://www.esdm.co.uk/Data/style/rss1.css" ?> <?xml-stylesheet type="text/xsl" href="https://www.esdm.co.uk/Data/style/rss1.xsl" ?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:itunes="http://www.itunes.com/dtds/podcast-1.0.dtd">
  <channel>
    <title>The knowledge base blog</title>
    <link>https://www.esdm.co.uk/knowledge</link>
    <description />
    <docs>http://www.rssboard.org/rss-specification</docs>
    <generator>mojoPortal Blog Module</generator>
    <language>en-GB</language>
    <ttl>120</ttl>
    <atom:link href="https://www.esdm.co.uk/Blog/RSS.aspx?p=138~108~71" rel="self" type="application/rss+xml" />
    <itunes:owner />
    <itunes:explicit>no</itunes:explicit>
    <item>
      <title>A regular expression for numbers from 0 to 100</title>
      <description><![CDATA[<p>I've been creating a web questionnaire (using the Forms Wizard module for mojoPortal CMS) that includes some questions where the answers were to be expressed as integer percentages. How to validate the responses? This was not quite as simple as I was hoping, as we need to use a RegularExpressionValidator and, as&nbsp;any fule kno<em>,</em> using regular expressions to solve a problem usually results in having two problems. So what's the expression? Of course regular expressions don't "understand" numbers,&nbsp;so&nbsp;it's not as simple as ^[0-100]$!</p>

<p>This expression seems to do the job without loopholes: ^([0-9]|[1-9][0-9]|100)$</p>

<p>If we want to permit decimals, then it gets more interesting. I'm no regexpert, but something like this should&nbsp;ensure we get either an integer from 0 to 100 or any decimal in between, with up to 2d.p. (also permitting 100.0 and 100.00!):</p>

<p>^100(\.[0]{1,2})?|([0-9]|[1-9][0-9])(\.[0-9]{1,2})?$</p>

<p>Spot any problems with these regular expressions...? Please comment and help me improve!</p>
<br /><a href='https://www.esdm.co.uk/a-regular-expression-for-numbers-from-0-to-100'>Crispin Flower</a>&nbsp;&nbsp;<a href='https://www.esdm.co.uk/a-regular-expression-for-numbers-from-0-to-100'>...</a>]]></description>
      <link>https://www.esdm.co.uk/a-regular-expression-for-numbers-from-0-to-100</link>
      <author>crispin.flower@idoxgroup.com (Crispin Flower)</author>
      <comments>https://www.esdm.co.uk/a-regular-expression-for-numbers-from-0-to-100</comments>
      <guid isPermaLink="true">https://www.esdm.co.uk/a-regular-expression-for-numbers-from-0-to-100</guid>
      <pubDate>Fri, 29 Jul 2016 17:55:00 GMT</pubDate>
    </item>
    <item>
      <title>asp.net - json compression</title>
      <description><![CDATA[<p>Dynamic content compression does not work by default in asp.net for ‘application/json’ mime types, and given that we’re doing more mobile apps and client side data requests this can make quite a difference to application performance. &nbsp;In flymapper my json response went from 0.4mb to 0.04mb.</p>

<p><a href="http://www.hanselman.com/blog/EnablingDynamicCompressionGzipDeflateForWCFDataFeedsODataAndOtherCustomServicesInIIS7.aspx">http://www.hanselman.com/blog/EnablingDynamicCompressionGzipDeflateForWCFDataFeedsODataAndOtherCustomServicesInIIS7.aspx</a></p>
<br /><a href='https://www.esdm.co.uk/aspnet-json-compression'>Stewart Bellamy</a>&nbsp;&nbsp;<a href='https://www.esdm.co.uk/aspnet-json-compression'>...</a>]]></description>
      <link>https://www.esdm.co.uk/aspnet-json-compression</link>
      <author>stewartb@esdm.co.uk (Stewart Bellamy)</author>
      <comments>https://www.esdm.co.uk/aspnet-json-compression</comments>
      <guid isPermaLink="true">https://www.esdm.co.uk/aspnet-json-compression</guid>
      <pubDate>Wed, 29 May 2013 04:24:00 GMT</pubDate>
    </item>
    <item>
      <title>IE10 errors when clicking icons in mojoPortal and ASP.Net 4 web sites fixed with .Net 4.5</title>
      <description><![CDATA[<p>I’ve noticed a couple of mojoPortal sites throwing errors when I click image buttons in the administration pages.&nbsp; For example, when editing page settings, clicking the little spanner icon to edit the settings of a feature instance would crash the site. This only started since I upgraded to IE10 (on Windows 7).&nbsp; </p> <p>This is typical of what I was seeing in the system log:</p> <p><font face="Courier New">2013-04-17 19:15:57,147 ERROR 192.168.54.5 - en-GB - /Admin/PageLayout.aspx?pageid=282 - mojoPortal.Web.Global -&nbsp; Referrer(ttp://www.mysite.co.uk/Admin/PageLayout.aspx?pageid=282) useragent Mozilla/5.0 (compatible; MSIE 10.0; Windows NT 6.1; WOW64; Trident/6.0; BOIE9;ENUS) <br>System.FormatException: Input string was not in a correct format. <br>&nbsp;&nbsp; at System.Number.StringToNumber(String str, NumberStyles options, NumberBuffer&amp; number, NumberFormatInfo info, Boolean parseDecimal) <br>&nbsp;&nbsp; at System.Number.ParseInt32(String s, NumberStyles style, NumberFormatInfo info) <br>&nbsp;&nbsp; at System.Web.UI.WebControls.ImageButton.LoadPostData(String postDataKey, NameValueCollection postCollection) <br>&nbsp;&nbsp; at System.Web.UI.WebControls.ImageButton.System.Web.UI.IPostBackDataHandler.LoadPostData(String postDataKey, NameValueCollection postCollection) <br>&nbsp;&nbsp; at System.Web.UI.Page.ProcessPostData(NameValueCollection postData, Boolean fBeforeLoad) <br>&nbsp;&nbsp; at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)</font> <br></p> <p>Joe Audette pointed out a possible solution <a href="https://www.mojoportal.com/Forums/Thread.aspx?pageid=5&amp;t=10864~1" target="_blank">in this thread</a> so I installed .Net 4.5 on the web server and the problem was cured.</p><br /><a href='https://www.esdm.co.uk/ie10-errors-when-clicking-icons-in-mojoportal-and-aspnet-4-web-sites-fixed-with-net-45'>Crispin Flower</a>&nbsp;&nbsp;<a href='https://www.esdm.co.uk/ie10-errors-when-clicking-icons-in-mojoportal-and-aspnet-4-web-sites-fixed-with-net-45'>...</a>]]></description>
      <link>https://www.esdm.co.uk/ie10-errors-when-clicking-icons-in-mojoportal-and-aspnet-4-web-sites-fixed-with-net-45</link>
      <author>crispin.flower@idoxgroup.com (Crispin Flower)</author>
      <comments>https://www.esdm.co.uk/ie10-errors-when-clicking-icons-in-mojoportal-and-aspnet-4-web-sites-fixed-with-net-45</comments>
      <guid isPermaLink="true">https://www.esdm.co.uk/ie10-errors-when-clicking-icons-in-mojoportal-and-aspnet-4-web-sites-fixed-with-net-45</guid>
      <pubDate>Wed, 17 Apr 2013 18:48:01 GMT</pubDate>
    </item>
    <item>
      <title>asp.net - UI culture and dates</title>
      <description><![CDATA[<p>Don't rely on DateTime.Now.ToString() to populate varchar database fields that are used for holding dates. &nbsp;Or even better still don't use varchar fields for holding dates in the database - unless you've inherited this&nbsp;scenario and don't want the risk/time to factor it out.</p>

<p>If, for example, the user inadvertantly has their browser language/culture set&nbsp;to say en-us instead of en-gb you'll get a date like so '03/31/2013 09:00:00 AM' instead of&nbsp;'31/03/2013 09:00:00'. &nbsp;This will then make any date processing you do on this field go SPLAT. &nbsp;Other developers/project manager may be mildly&nbsp;curious as to why&nbsp;you're&nbsp;using a varchar field to hold a date, at which time you will promptly blame&nbsp;someone else for it :)&nbsp;<em> (He did, Ed.)</em></p>

<p>Solution, set the culture in the web.config</p>

<pre style="color: black; font-family: Consolas;">
<span style="color: blue;">&lt;</span><span style="color: rgb(163, 21, 21);">globalization</span><span style="color: blue;">&nbsp;</span><span style="color: red;">culture</span><span style="color: blue;">=</span>"<span style="color: blue;">en-gb</span>"<span style="color: blue;">&nbsp;</span><span style="color: red;">uiCulture</span><span style="color: blue;">=</span>"<span style="color: blue;">en-gb</span>"<span style="color: blue;">&nbsp;&nbsp;/&gt;</span></pre>

<p>There is no quick and dirty,&nbsp;only dirty.</p>

<p>&nbsp;</p>
<br /><a href='https://www.esdm.co.uk/aspnet-ui-culture-and-dates'>Stewart Bellamy</a>&nbsp;&nbsp;<a href='https://www.esdm.co.uk/aspnet-ui-culture-and-dates'>...</a>]]></description>
      <link>https://www.esdm.co.uk/aspnet-ui-culture-and-dates</link>
      <author>stewartb@esdm.co.uk (Stewart Bellamy)</author>
      <comments>https://www.esdm.co.uk/aspnet-ui-culture-and-dates</comments>
      <guid isPermaLink="true">https://www.esdm.co.uk/aspnet-ui-culture-and-dates</guid>
      <pubDate>Tue, 09 Apr 2013 02:32:00 GMT</pubDate>
    </item>
  </channel>
</rss>