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

  • Thread starter Thread starter Guest
  • Start date Start date
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
 
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?
 
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?
 
Back
Top