Здравствуйте, Dikaaa, Вы писали:
A>>A kakoj versii ASP.NET 1.1 ili 2?
D>2.0
public void Page_Load(Object sender, EventArgs e)
{
// Define the name and type of the client script on the page.
String csname = "OnSubmitScript";
Type cstype = this.GetType();
// Get a ClientScriptManager reference from the Page class.
ClientScriptManager cs = Page.ClientScript;
// Check to see if the OnSubmit statement is already registered.
if (!cs.IsOnSubmitStatementRegistered(cstype, csname))
{
String cstext = @"
var i, val, controlFailedValidation;
for (i = 0; i < Page_Validators.length; i++)
{
val = Page_Validators[i];
if (! val.isvalid)
{
controlFailedValidation = val.controltovalidate;
// *** menyaj/podkrashivaj control zdes'
// *** ispol'zuya style
controlFailedValidation.style.bgcolor = 'red';
}
Здравствуйте, agzis1, Вы писали:
A>Здравствуйте, Dikaaa, Вы писали:
A>>>A kakoj versii ASP.NET 1.1 ili 2?
D>>2.0
A>public void Page_Load(Object sender, EventArgs e) A> { A> // Define the name and type of the client script on the page. A> String csname = "OnSubmitScript"; A> Type cstype = this.GetType();
A> // Get a ClientScriptManager reference from the Page class. A> ClientScriptManager cs = Page.ClientScript;
A> // Check to see if the OnSubmit statement is already registered. A> if (!cs.IsOnSubmitStatementRegistered(cstype, csname)) A> { A> String cstext = @" A> var i, val, controlFailedValidation; A> for (i = 0; i < Page_Validators.length; i++) A> { A> val = Page_Validators[i];
A> if (! val.isvalid) A> { A> controlFailedValidation = val.controltovalidate; A> // *** menyaj/podkrashivaj control zdes' A> // *** ispol'zuya style A> controlFailedValidation.style.bgcolor = 'red'; A> }
A> } A> "; A> cs.RegisterOnSubmitStatement(cstype, csname, cstext); A> }
A> }
izvinyayus' chto kod neoformatirovan.
Re[4]: Как повесить скрипт на событие валидации (+)