Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > onTextChanged not firing

Reply
Thread Tools

onTextChanged not firing

 
 
kbrandl@gmail.com
Guest
Posts: n/a
 
      02-01-2005
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???

 
Reply With Quote
 
 
 
 
=?Utf-8?B?c2FyYQ==?=
Guest
Posts: n/a
 
      02-02-2005
Hi kbrandl
Change the property of textbox
AutoPostBack to true
this will work



"(E-Mail Removed)" 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???
>
>

 
Reply With Quote
 
 
 
 
kbrandl@gmail.com
Guest
Posts: n/a
 
      02-02-2005
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?

 
Reply With Quote
 
=?Utf-8?B?c2FyYQ==?=
Guest
Posts: n/a
 
      02-02-2005
Try to write ur code in apsx.vb or aspx.cs
may be it work

"(E-Mail Removed)" 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?
>
>

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
OnTextChanged not working kj ASP .Net Web Controls 1 05-16-2007 11:38 AM
OnTextChanged not firing?? =?Utf-8?B?TmVpbA==?= ASP .Net 3 08-29-2005 08:54 AM
onTextChanged event not firing with ENTER key mdipiet ASP .Net 1 05-11-2005 08:05 PM
textbox's state does not persist if onTextChanged not defined Henri ASP .Net 6 08-06-2004 02:08 PM
OnTextChanged in datagrid not working Eidolon ASP .Net Web Controls 1 05-20-2004 03:14 AM



Advertisments