| |

VerySource

 Forgot password?
 Register
Search
View: 898|Reply: 8

How to make the validation control valid in the current user control and invalid outside the user control Thank you

[Copy link]

2

Threads

6

Posts

4.00

Credits

Newbie

Rank: 1

Credits
4.00

 China

Post time: 2020-3-22 17:30:01
| Show all posts |Read mode
I have N user controls all on the same page
And each page has a button and N validation controls

When I click on a user control, it always prompts that the verification of other user controls is not successful
You must always succeed before you can execute the button

ask:
How to make the validation control valid in the current user control and invalid outside the user control
Reply

Use magic Report

0

Threads

322

Posts

115.00

Credits

Newbie

Rank: 1

Credits
115.00

 China

Post time: 2020-7-2 15:30:01
| Show all posts
How to make the validation control valid in the current user control and invalid outside the user control
=======
Do you mean that it is only valid for the buttons in the current control?
Reply

Use magic Report

0

Threads

322

Posts

115.00

Credits

Newbie

Rank: 1

Credits
115.00

 China

Post time: 2020-7-2 17:30:01
| Show all posts
This is basically difficult unless you don't use its authentication control.
The entire page is used
ValidatorCommonOnSubmit this function to verify.
Reply

Use magic Report

0

Threads

64

Posts

35.00

Credits

Newbie

Rank: 1

Credits
35.00

 China

Post time: 2020-7-3 10:30:01
| Show all posts
Use ValidationGroup to control.
Reply

Use magic Report

0

Threads

1

Posts

2.00

Credits

Newbie

Rank: 1

Credits
2.00

 China

Post time: 2020-7-3 11:30:02
| Show all posts
The plan is like upstairs
Option two uses a program to control events through server-side verification events.
Reply

Use magic Report

0

Threads

18

Posts

15.00

Credits

Newbie

Rank: 1

Credits
15.00

 China

Post time: 2020-7-5 09:15:01
| Show all posts
Use ValidationGroup to group the validation controls, for example textbox1 textbox2 textbox3 under a validation, then you can set their ValidationGroup to the same
Reply

Use magic Report

0

Threads

322

Posts

115.00

Credits

Newbie

Rank: 1

Credits
115.00

 China

Post time: 2020-7-5 13:00:01
| Show all posts
Use ValidationGroup to group the validation controls, for example textbox1 textbox2 textbox3 under a validation, then you can set their ValidationGroup to the same
==========

And also the button ValidationGroup is the same. This is the key.
Reply

Use magic Report

1

Threads

18

Posts

14.00

Credits

Newbie

Rank: 1

Credits
14.00

 China

Post time: 2020-7-5 15:15:01
| Show all posts
ValidationGroup can be controlled, set it as a group
-----
How to make the user control and calling control page also effective,
----
For example: a page has two user controls, the button on the page is clicked, and the user control must be verified, but the click of one of the user controls cannot trigger the verification of the other user control, what should I do
Reply

Use magic Report

0

Threads

322

Posts

115.00

Credits

Newbie

Rank: 1

Credits
115.00

 China

Post time: 2020-7-5 16:00:01
| Show all posts
For example: a page has two user controls, the button on the page is clicked, and the user control must be verified, but the click of one of the user controls cannot trigger the verification of the other user control, what should I do
========

All controls that need to be verified (such as TextBox) and controls that trigger events (such as buttons) in the same user control
The ValidationGroup has the same name (not the same name as other user controls).
Reply

Use magic Report

You have to log in before you can reply Login | Register

Points Rules

Contact us|Archive|Mobile|CopyRight © 2008-2023|verysource.com ( 京ICP备17048824号-1 )

Quick Reply To Top Return to the list