Some time ago to see a master in the garden wrote a pure Css+js effect, I put it and asp.net validation control, with this master write effect as asp.net difficult to control the hint effect. The following figure
and previously written more convenient to use than this write, as long as each page inherits BasePage, where the validator folder is a required folder.
Code
Copy Code code as follows:
Namespace Validatortest
{
public partial class Default: <span style= "COLOR: #ff00ff" >WebApp.BasePage</SPAN>
{
protected void Page_Load (object sender, EventArgs e)
{
}
protected void btnSubmit_Click (object sender, EventArgs e)
{
string url = Request.Url.LocalPath;
if (! Page.IsValid)
{
Stringutil.jalerttoredirect ("illegal submission!") ", URL);
Return
}
Stringutil.jalerttoredirect ("Thank you for your test!") ", URL);
}
}
}
Example Downloads