OnTextChanged in datagrid not working

E

Eidolon

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!
 
V

Vidar Petursson

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/d...hor/dhtml/reference/dhtml_reference_entry.asp
http://msdn.microsoft.com/downloads...rnet/behaviors/library/webservice/default.asp

--
Best Regards
Vidar Petursson
==============================
Microsoft Scripting MVP
http://www.microsoft.com/technet/scriptcenter
==============================
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,904
Latest member
HealthyVisionsCBDPrice

Latest Threads

Top