Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Web Controls > OnTextChanged in datagrid not working

Reply
Thread Tools

OnTextChanged in datagrid not working

 
 
Eidolon
Guest
Posts: n/a
 
      05-19-2004
HELP!

I have a datagrid, and there are several textboxes in each row with an
ontextchanged attribute pointing to a server-side function. All well and
good.
Now that part that baffles me.......

In the first 40% of the rows, the textboxes dont work, but in the last rows
they do. For example, when i load the page, i have 12 rows, only the
textboxes in the last 5 rows actually fire OnTextChanged though. However all
of them DO perform a postback. Just the first ones never get around to
calling the OnChanged method i have.

Given a textBox with a (simplified) id of "myBox" I have checked the values
of
Request("myBox") and
CType(Me.FindControl("myBox"),TextBox).Text
and they ARE different. so the server does know that the value changed, but
for whatever reason, it refuses to fire the change event for the first 40%
rows.

Any ideas???
THANKS in advance, its driving me BaTtY!


 
Reply With Quote
 
 
 
 
Vidar Petursson
Guest
Posts: n/a
 
      05-20-2004
Hi

Are you really doing a postback on each change?
I would rather use onblur="if(this.value!=this.defaultValue){
if(doStoreIt(this.name,this.value)) this.defaultValue=thisValue">
Where doStore would return true/false

And instead of postback I would use webservices behaviour or a hidden iframe
to
store the changes

More info:
http://msdn.microsoft.com/library/de...ence_entry.asp
http://msdn.microsoft.com/downloads/...ce/default.asp

--
Best Regards
Vidar Petursson
==============================
Microsoft Scripting MVP
http://www.microsoft.com/technet/scriptcenter
==============================
"Eidolon" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> HELP!
>
> I have a datagrid, and there are several textboxes in each row with an
> ontextchanged attribute pointing to a server-side function. All well and
> good.
> Now that part that baffles me.......
>
> In the first 40% of the rows, the textboxes dont work, but in the last
> rows
> they do. For example, when i load the page, i have 12 rows, only the
> textboxes in the last 5 rows actually fire OnTextChanged though. However
> all
> of them DO perform a postback. Just the first ones never get around to
> calling the OnChanged method i have.
>
> Given a textBox with a (simplified) id of "myBox" I have checked the
> values
> of
> Request("myBox") and
> CType(Me.FindControl("myBox"),TextBox).Text
> and they ARE different. so the server does know that the value changed,
> but
> for whatever reason, it refuses to fire the change event for the first 40%
> rows.
>
> Any ideas???
> THANKS in advance, its driving me BaTtY!
>
>



 
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 not firing kbrandl@gmail.com ASP .Net 3 02-02-2005 03:25 PM
textbox's state does not persist if onTextChanged not defined Henri ASP .Net 6 08-06-2004 02:08 PM
Datagrid Setting Focus and "ontextchanged" Derek Mendez ASP .Net Datagrid Control 11 04-28-2004 12:52 AM



Advertisments