Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

Hi all,

 

Have a number of required field validators on my web form. The EnableClientScript is set to False. I also have validation summary control on my page.

 

When I hit the save button, a method called ExecuteValidation is called. This method firstly calls the individual validators.

 
me.requiredFieldValidator1.validate
me.requiredFieldValidator2.validate
me.requiredFieldValidator3.validate

 

The method then proceeds to check if the validator is correct or not.

if me.requiredFieldValidator1.isvalid = false then
 ExecuteValidation = false
end if
if me.requiredFieldValidator2.isvalid = false then
 ExecuteValidation = false
end if
if me.requiredFieldValidator3.isvalid = false then
 ExecuteValidation = false
end if

 

The problem that I am having is that I want the validation statements for requiredFieldValidator 1, 2, and 3 to appear in the order 1, 2, 3. However I practice the order is constantly changing.

 

Any suggestions on how to control the order?

 

Mike55.

A Client refers to the person who incurs the development cost.

A Customer refers to the person that pays to use the product.

------

My software never has bugs. It just develops random features. (Mosabama vbforums.com)

  • Administrators
Posted

IIRC you shouldn't have to manually invoke the validators on a post back - the framework should invoke them automatically.

If you want to check if things worked or not you could then check to see if a validator is valid or not or alternatively just query Page.IsValid to detect if any errors are present and act accordingly.

Posting Guidelines FAQ Post Formatting

 

Intellectuals solve problems; geniuses prevent them.

-- Albert Einstein

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...