﻿function CheckForSpecialCharacters(src, arg)
{
    arg.IsValid = CheckSpecialCharacters(arg.Value);
}
// Checks For Special Character combination '&#' and for characters '<' & '>'.
function CheckSpecialCharacters(strCode)
{
    if(strCode.length == 0)
        return true;
    var invalidList = "&#";
		
	//Check if &#.
	if ( strCode.indexOf( invalidList ) != -1 )
		return false;
	
	invalidList = "<>'|~";
	//Check if invalid characters are contained in the code.
	for(var i = 0; i < strCode.length; i++)
	{
		if( invalidList.indexOf(strCode.charAt(i) )!= -1)
		{
		return false;
		}
	}
	
	return true;
}
    window.history.go(1); //for avoiding reloading of page when login page's back button is pressed      

