Hi all I have written a sample code to check an user available with the given name, if available I would like to display the text with Red color saying Username in use, for this I have written as follows but the text is not showing
[OutputCache(Location = OutputCacheLocation.None, NoStore = true)]
public JsonResult IsUserNameAvailable(string UserName)
{
var usrAvailable = db.tblUsers.Where(p => p.UserName == UserName).Select(img => img.UserName).FirstOrDefault();
if (usrAvailable == null)
{
return Json("Username is available", JsonRequestBehavior.AllowGet);
}
return Json("<span style='color:Red;> Username in use</span>", JsonRequestBehavior.AllowGet);
}
Can some one help me