accessing label in usercontrol from javascript

F

Fabrizio

This is the scene:
i have a user control IN a user control with a label inside named lblStato that must blink; i cannot use <BLINK> tag; having this in a webform a use this code
Page.RegisterStartupScript("BlinkStatus", "<script>" _
& "setTimeout(BlinkStatusText,500);" _
& "function BlinkStatusText() { " _
& "if (document.getElementById('lblStato').style.visibility=='visible') {" _
& "document.getElementById(lblStato').style.visibility='hidden'} else {" _
& "document.getElementById('lblStato').style.visibility='visible'}" _
& "setTimeout(BlinkStatusText,1000)}" _
& "</script>")
and works fine, unluckily having a label in user control it doesn't work.
I checked the html resulting and saw that, having the first user control named oMapDet and the nested one oMapDetGeneral the label is named oMapDet_oMapDetGeneral_lblStato; i tried using this name but still doesn't work.

Two question:
1) How to make this work again
2) if my user control is in two webforms it can be called oMapDet, oMapDet2, oTest etc... How can i know in the user control source code what is my name in a particular context ?

thanks,
Fabrizio
 
F

Fabrizio

Seems like the web access to the newsgroups has temporary gone nuts (at least to me, i can get to my post just through search, instead i get december posts)

However, for the history i got bot problems fixed
1) the javascript problem what a typo :
2) Using me.clientId gives the name that the control will have client side, perfect also with a user control inside a user contro

Tks however to those who passed
 

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,769
Messages
2,569,579
Members
45,053
Latest member
BrodieSola

Latest Threads

Top