473,796 Members | 2,632 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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

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
Nov 18 '05 #1
2 3978
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" <Ow**@discussio ns.microsoft.co m> wrote in message
news:96******** *************** ***********@mic rosoft.com...
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

---
Outgoing mail is certified Virus Free. (well i'd like to think it is.. )
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.720 / Virus Database: 476 - Release Date: 14/07/2004
Nov 18 '05 #2
when u say user control u mean an .ascx page with a textbox ? or u inherited
and redifined the textbox class ?

"Owin" <Ow**@discussio ns.microsoft.co m> wrote in message
news:96******** *************** ***********@mic rosoft.com...
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

---
Outgoing mail is certified Virus Free. (well i'd like to think it is.. )
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.720 / Virus Database: 476 - Release Date: 14/07/2004
Nov 18 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
12332
by: KathyB | last post by:
Hi, clearly I'm just not getting something here. I have an aspx form with ONE textbox and several label controls on it. I have the textbox set to AutoPostBack = True, but when I enter my text and hit ENTER, nothing fires. Oddly enough, this is similar to the button problem I've just posted as well. I use similar code for the textbox textchanged event, but it doesn't fire on that page either IF I remove the button (even though I don't...
1
4549
by: Samuel Chan | last post by:
I used the textchanged event of textbox and set the autopostback property to true. The textchanged event should fire when the content of the textbox is changed and user tab out of the textbox control. However, textchanged event fires whenever there is a postback, even when I click a button that send postback. Can anybody tell we what change I should make so that textchanged event only fire when the content is changed?
3
4631
by: Kurt Schroeder | last post by:
I'm setting focus depenting upon which field has changed value. I'm doing this with the following: Page.RegisterStartupScript("SetFocus", "<script language=""Jscript"" > document.getElementById(""txtCity"").focus(); </Script>"). This is being called on the textChanged event for textboxes. for city it goes to state for state it goes to zip, ... It works, but is this the correct way to do this or should this be a seties of if then else's in...
1
2899
by: Zyrthofar | last post by:
Hi I have three textboxes indicating the individual RGB values of a color. When the user leaves a textbox (Leave event), I check the validity of that number and saves the three values to a set of raw data... The sub used handles the three textboxes's Leave events, and uses the 'sender' variable... Now I have a picturebox with GDI+ circles in it, representing the 8 different colors in the palette. You can choose the color number by...
3
4294
by: Robert W. | last post by:
I'm new to ASP.net programming so excuse my ignorance if the following question seems overly simplistic. I've created a simple Login form with 3 primary WebControls: - A TextBox for the Username - A TextBox for the Password - A Button labelled "Submit" If the user enters a correct username/password combination then he's taken to another page. But if either or both are incorrect then a simple message
1
4053
by: jeeber | last post by:
I saw this on another thread (Francesco November 15th, 2005 UserControl.TextChanged) but I didn't see how to add to the discussion, so I'm just starting a new one and hope that people find it. The original problem was creating a user control and trying to use existing event types like "TextChanged", if you were creating a control that was similar to a text box, for example. The problem was that the developers at Microsoft decided that this...
1
3897
by: koraykazgan | last post by:
Hi all, I have a user control (ASCX). In that user control there is a panel, and inside that panel there is a textbox and a button. The panel has a DefaultButton property set, which is set to the button inside it. I also have a page, and on that page there are two instances of that user control (uc1 and uc2). I additionaly have an update panel on the page. In that update panel there is a label. This update panel has two async triggers...
6
3591
by: Mark B | last post by:
I have a function that looks up a SQL table to see if a search term matches. It works fine but so far there are two things yet to work: 1) After entering a search term and pressing Enter, nothing has been happening. It has only been searching when I click the Search button. 2) Neither of the Response.Write's have been displaying any text. Here's the code:
9
3024
by: David C | last post by:
I have an asp.net page that contains a FormView with several controls bound to a SqlDataSource. One of the controls is a TextBox bound to a date column. I have the following additional properties on the TextBox: OnTextChanged="txtDestroyed_TextChanged" AutoPostBack="true" I expected the OnTextChanged event to fire immediately and run the postback but it does not. The code does not run until I click the "Update" button. Can anyone...
0
9680
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10455
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10006
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7547
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6788
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5441
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5573
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3731
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2925
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.