﻿<?xml version="1.0" encoding="utf-8"?><rss version="2.0"><channel><title>Ayende @ Rahien</title><link>http://ayende.com</link><description>Ayende @ Rahien</description><copyright>Copyright (C) Ayende Rahien  2004 - 2021 (c) 2026</copyright><ttl>60</ttl><item><title>Sergio Pereira commented on Code smell</title><description>I see your point... Looks ugly no matter what; but at least it can be made less verbose if you add a helper method in you page class (hopefully a common base class):
  
protected string R(string policyResName)
  
{
  
  //figure this code out :)
  
  return phrase;
  
}
  
  
And your script could be reduced to:
  
  
if($F('&lt;%= PolicyDescription.ClientID %&gt;')== 
  
    '&lt;%=R("DescriptionNotFound")%&gt;' ) 
  
{ 
  
    alert('&lt;%=R("EnterValidPolicyNumberOrDescription") %&gt;'); 
  
    return; 
  
} 
  
  
</description><link>http://ayende.com/2254/code-smell#comment1</link><guid>http://ayende.com/2254/code-smell#comment1</guid><pubDate>Mon, 26 Mar 2007 18:00:24 GMT</pubDate></item></channel></rss>