Display MessageBox in Asp.net
Use javascript alert to display Message box in asp.neteg:
Response.Write(<script>alert('Hello')</script>);
Browser Compatability
if (Request.UserAgent.IndexOf("AppleWebKit") > 0)
{
Request.Browser.Adapters.Clear();
}
LogOut(SessionEnd)
Session.Abandon();
FormsAuthentication.SignOut();
Response.Redirect("~/example.aspx");
TextBox Blur if it's Empty
Take 1 textbox, 1button, and 1required field validator...
Using Java Script
<style type="text/css">
.ErrorControl
{
background-color: #FBE3E4;
border: solid 1px Red;
}
.style1
{
width: 368px;
}
</style>
<link rel="openid.server" href="http://openid.example.
<script type="text/javascript">
function WebForm_OnSubmit() {
if (typeof (ValidatorOnSubmit) == "function" && ValidatorOnSubmit() == false)
{
for (var i in Page_Validators)
{
try
{
var control = document.getElementById(Page_Validators[i].controltovalidate);
if (!Page_Validators[i].isvalid)
{
control.className = "ErrorControl";
} else {
control.className = "";
}
} catch (e) { }
}
return false;
}
return true;
}
</script>
{
control.className = "ErrorControl";
} else {
control.className = "";
}
} catch (e) { }
}
return false;
}
return true;
}
</script>