How to trigger textchanged event of a user control on page submit?

G

Guest

Hi all,

I've created an User control. It's an extension of a textbox wich has some extra properties so that validation becomes a lot faster.

The control wordks great if autopostback is on. When there's a value in the textbox, the (overridden) textchanged event fires and validation is performed.

Now I want to turn off autopostback. So I want my contol only validate if the submit button is pressed. I've tried Page.Validate(), but It seems only to trigger Validators. My control doesn't have to have validators, but just raises an error.

So, I think the question is: how do I trigger the overridden textchanged event of my custom control, preferably without writing code in de click event of the submit-button?

Greetz,
Owin
Amsterdam
 
M

Mike Smith

Odd.. shouldnt it trigger it iself since autopostback is turned off.. the
submit button should cause the textchanged event to trigger as long as u did
cause a change in the textbox...

Owin said:
Hi all,

I've created an User control. It's an extension of a textbox wich has some
extra properties so that validation becomes a lot faster.
The control wordks great if autopostback is on. When there's a value in
the textbox, the (overridden) textchanged event fires and validation is
performed.
Now I want to turn off autopostback. So I want my contol only validate if
the submit button is pressed. I've tried Page.Validate(), but It seems only
to trigger Validators. My control doesn't have to have validators, but just
raises an error.
So, I think the question is: how do I trigger the overridden textchanged
event of my custom control, preferably without writing code in de click
event of the submit-button?
 
M

Mike Smith

when u say user control u mean an .ascx page with a textbox ? or u inherited
and redifined the textbox class ?

Owin said:
Hi all,

I've created an User control. It's an extension of a textbox wich has some
extra properties so that validation becomes a lot faster.
The control wordks great if autopostback is on. When there's a value in
the textbox, the (overridden) textchanged event fires and validation is
performed.
Now I want to turn off autopostback. So I want my contol only validate if
the submit button is pressed. I've tried Page.Validate(), but It seems only
to trigger Validators. My control doesn't have to have validators, but just
raises an error.
So, I think the question is: how do I trigger the overridden textchanged
event of my custom control, preferably without writing code in de click
event of the submit-button?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top