473,406 Members | 2,371 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

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="HoursWorkedDate_TextBox"
Runat="server" width="80px" CssClass="inputstyle"
onBlur='javascript:Search.submit();' 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_Changed" method to execute. This is working
correctly.

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

<asp:TextBox Width="40px" CssClass="inputstyle" MaxLength="4"
ID="HoursWorked_TextBox" Runat="server" Value='<%#
DataBinder.Eval(Container.DataItem, "UpdateHoursWorked")%>'
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 11738
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="HoursWorkedDate_TextBox"
Runat="server" width="80px" CssClass="inputstyle"
onBlur='javascript:Search.submit();' 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_Changed" method to execute. This is working
correctly.

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

<asp:TextBox Width="40px" CssClass="inputstyle" MaxLength="4"
ID="HoursWorked_TextBox" Runat="server" Value='<%#
DataBinder.Eval(Container.DataItem, "UpdateHoursWorked")%>'
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=True 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=True 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=True 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=True 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
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...
3
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...
1
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...
4
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...
1
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...
4
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...
0
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...
1
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. ...
4
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"...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
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,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
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,...
0
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...
0
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...

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.