473,789 Members | 2,706 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

onTextChanged not firing

On my page, there is a textbox at the top that contains a date -- and a
fully-editable datagrid below (each row in the datagrid contains an
editable textbox, along with some other controls).

The date textbox is defined as:

<asp:TextBox EnableViewState ="True" ID="HoursWorked Date_TextBox"
Runat="server" width="80px" CssClass="input style"
onBlur='javascr ipt:Search.subm it();' OnTextChanged=" Date_Changed" />

When the date is changed, and the textbox loses focus (onBlur), the
page is submitted, causing the OnTextChanged event to fire and the
server-side "Date_Chang ed" method to execute. This is working
correctly.

Each textbox within the fully-editable datagrid is defined as follows:

<asp:TextBox Width="40px" CssClass="input style" MaxLength="4"
ID="HoursWorked _TextBox" Runat="server" Value='<%#
DataBinder.Eval (Container.Data Item, "UpdateHoursWor ked")%>'
OnTextChanged=" DG_RowChanged" />

I would expect that if I change data within the textboxes of the
editable datagrid, and the page is submitted, the OnTextChanged event
would fire for any changed rows. This works fine if I submit the page
by clicking the submit button...but not if the page submits by the Date
textbox at the top of the page being changed.

If I change the data within the data grid, then change the date at the
top of the page and hit ENTER, the page refreshes -- but only the
OnTextChanged event associated with the Date textbox fires...the
OnTextChanged events associated with the datagrid textboxes do NOT
fire. What am I doing wrong here???

Nov 19 '05 #1
3 11781
Hi kbrandl
Change the property of textbox
AutoPostBack to true
this will work

"kb*****@gmail. com" wrote:
On my page, there is a textbox at the top that contains a date -- and a
fully-editable datagrid below (each row in the datagrid contains an
editable textbox, along with some other controls).

The date textbox is defined as:

<asp:TextBox EnableViewState ="True" ID="HoursWorked Date_TextBox"
Runat="server" width="80px" CssClass="input style"
onBlur='javascr ipt:Search.subm it();' OnTextChanged=" Date_Changed" />

When the date is changed, and the textbox loses focus (onBlur), the
page is submitted, causing the OnTextChanged event to fire and the
server-side "Date_Chang ed" method to execute. This is working
correctly.

Each textbox within the fully-editable datagrid is defined as follows:

<asp:TextBox Width="40px" CssClass="input style" MaxLength="4"
ID="HoursWorked _TextBox" Runat="server" Value='<%#
DataBinder.Eval (Container.Data Item, "UpdateHoursWor ked")%>'
OnTextChanged=" DG_RowChanged" />

I would expect that if I change data within the textboxes of the
editable datagrid, and the page is submitted, the OnTextChanged event
would fire for any changed rows. This works fine if I submit the page
by clicking the submit button...but not if the page submits by the Date
textbox at the top of the page being changed.

If I change the data within the data grid, then change the date at the
top of the page and hit ENTER, the page refreshes -- but only the
OnTextChanged event associated with the Date textbox fires...the
OnTextChanged events associated with the datagrid textboxes do NOT
fire. What am I doing wrong here???

Nov 19 '05 #2
I've already tried that...when I set AutoPostBack=Tr ue for the 'Date'
textbox at the top, the form correctly posts when the text is
changed...but still the OnTextChanged events don't fire for any of the
modified textboxes within the datagrid below. Although setting
AutoPostback=Tr ue for the textboxes within the datagrid does work --
there's a big issue with this -- it prevents the user from simply
tabbing though the input textboxes in the grid -- since when they enter
text and tab, the page submits, causing the page to receive focus
again, instead of the next input element. Any other ideas?

Nov 19 '05 #3
Try to write ur code in apsx.vb or aspx.cs
may be it work

"kb*****@gmail. com" wrote:
I've already tried that...when I set AutoPostBack=Tr ue for the 'Date'
textbox at the top, the form correctly posts when the text is
changed...but still the OnTextChanged events don't fire for any of the
modified textboxes within the datagrid below. Although setting
AutoPostback=Tr ue for the textboxes within the datagrid does work --
there's a big issue with this -- it prevents the user from simply
tabbing though the input textboxes in the grid -- since when they enter
text and tab, the page submits, causing the page to receive focus
again, instead of the next input element. Any other ideas?

Nov 19 '05 #4

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

Similar topics

6
4742
by: Henri | last post by:
Very strange problem : if I write: <asp:TextBox runat="server" id="myBox" /> the control's ViewState stays always empty, so it loses its properties if it's not always displayed. But if I write:
3
3549
by: Neil | last post by:
Hi, I have a datagrid containing a number of item templates, inside of these item templates I have various controls like the textbox. The user is able to edit all the fields on the datagrid at once and then click an update button. I'm trying to use the OnTextChanged event to capture which rows where updated before I update the DB. I have added the line OnTextChanged="RowChanged" to my text box control in the HTML and added the event...
1
16543
by: Alex Nitulescu | last post by:
Hi. I have created a web-based file manager. Now I'd like to watch a folder for changes, and when a change occurs I'd like to refresh my page. Okay. So I have created a FileSystemWatcher set on the folder I need to watch. It works fine. The problem occurs when I need to trigger an automatic Refresh. So I added two handlers - OnChanged and OnRename, in the same class as my filemanager.
4
2594
by: Chris | last post by:
I think I already know the answer to this but here goes. I've read the other postings but no solutions for this. If a user enters a textbox, there is no 'onenter', etc. to control firing off a sub, etc. We have OnTextChanged. But it doesn't fire until focus is placed somewhere else. The issue is that on my form if a user changes a textbox but goes to 'Save' the form, the 'Save' button gets the focus and fires event OnTextChanged but stops...
1
2756
by: mdipiet | last post by:
I've got a form that is supposed to validate data entry from a bar code scanner. The scanner is set up to add a carriage return at the end of the data in the barcode, which should fire the onTextChanged event to validate the information recieved; however, the Enter key does not fire this event as it should. Can anyone give me some help as to why the Enter key won't fire the onTextChanged event? Matt
4
7401
by: MattB | last post by:
Hi. I'm working on an intranet application that requires a user to input information about themselves. I have a user control with a couple of textboxes that I want the user to enter their weight into. One is for Lbs and one is for kg and I'm using the OnTextChanged event to populate the other control if one is filled in (converting between kg and Lbs). It works, but when one TextBox is changed and it sets the other's value, the second...
0
1447
by: RajS | last post by:
Hi All, I am trying to update datagrid, onTextchanged event, I dont know how to do this. please shed some light or any examples. Here is the code I am wrestling with. OnTextChanged event of Textbox1 I want to pass price and ID to this event, how can I pass? //DataGrid html code <asp:TextBox id="Textbox1" Text='<%#
1
2073
by: madhanmss | last post by:
Hi, i have two textboxes to enter the start and end dates. I am using javascript calendar to populate these text boxes. Based on the chosen date values, i need to filter a treeview control. The problem is, the ontextchanged event of the textbox is not firing, when the date is chosen from the javascript calendar. If you enter the date directly into the textbox, the event is firing. I need to find out how to fire the ontextchanged...
4
2253
by: RobertTheProgrammer | last post by:
Help! I have an ASP textbox where the OnTextChanged event is not firing. Here's the call: <asp:TextBox ID="ApproverCopy" runat="server" CssClass="noShow" OnTextChanged="StoreNewTrainings" AutoPostBack="True"></asp:TextBox></TD> The event fires if I enter the value manually, but not when I do it programmatically in the code behind. Please help.
0
9666
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
10410
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...
1
10139
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9984
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...
0
6769
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
5418
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...
1
4093
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3701
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2909
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.