Code smell
Why does it have to be like this?
if($F('<%= PolicyDescription.ClientID %>')==
'<asp:Literal runat="server" Text="<%$ Resources:PolicyResources, DescriptionNotFound %>"/>')
{
alert('<asp:Literal runat="server" Text="<%$ Resources:PolicyResources, EnterValidPolicyNumberOrDescription %>"/>');
return;
}
Comments
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('<%= PolicyDescription.ClientID %>')==
{
}
Comment preview