javascript bafflement in datagrid

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi folks, I'm using ASP.net with Framework 1.1 and C#

to go into my actual problem and fully explain would take more than any of
us could take (me writing it, you reading it)

however I can boil down one baffling aspect into a nutshell

I know about getElementById(' ') and it takes the literal id of a control,
or a variable with that value in it. I also know that you can get all
elements that are of a certain type using a wildcard...

what would be great is if you can give a wildcard to the getElementById
method

the reason being that the textbox I want to write back to in the grid is
called txtUserId in the declarative HTML , but DGMappings_ctl4_txtuserId on
the actual page

the 4 being the 3 rd of the datagrid...

so any wildcard ways of getting an element by ID or any suggested workarounds?

Regards and thanks in advance
CharlesA
 
Hi Eliyahu,
there should be, but because it's in the datagrid it has the format

DatagridName__ctlRowcount_txtUserId

when you go into Editmode

Cheers
CharlesA
 
If you emit your javascript into the page server-side
("RegisterClientScriptBlock")
you can use the Control.UniqueId property to have the javascript
specifically look for the "DGMappings_ctl4_txtuserId "
unique id client-side.

Peter
 
Thanks peter but UniqueID does not return the

Datagrid__ctlx_txtUserId naming format that the renderer uses

it returns just txtUserId
Regards
CharlesA
 

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

Back
Top