Client-side scripting on server control

M

Mantorok

Hi all

Is it possible to have client-side scripts executed from server controls, I
have a BulletList control and when they click on an item in the list I need
some javascript to be executed.

Thanks
Kev
 
M

Mantorok

Eliyahu Goldin said:
Kev,

You need to attach client-side events to the control. You need to
understand
what HTML elements the control renders as and how to get to the elements
from server code.

Do you have any examples or guidance for me on achieving that?

Thanks
Kev
 
J

Juan T. Llibre

re:
it's a v2.0 control.

Is it ? I can't find it in my 2.0 documentation,
nor on the online msdn2 docs. Would you post an online reference ?

I know it's a Display mode for the <asp:ValidationSummary control :
DisplayMode="BulletList | List ( but that works in v 1.1, too )
or, more properly, it's one of the Members of the DisplayMode
Enumeration ( the others are "List" and "SingleParagraph ).

I thought it could be a control which Dino Esposito authored :
http://www.code-magazine.com/article.aspx?quickid=0309051&page=2
 
M

Mantorok

Aha, thank you, i'll give that a go.

Kev

Eliyahu Goldin said:
Look at Attributes property. You need to know what client event you want
to
handle and set the attribute for this event to the name of a javascript
function that will handle it.:

myList.Attributes["<client event>"]="handleTheEvent();";

Again, you need to find out what html tag the BulletedList is rendered as
and what event you need to handle for this tag.

Eliyahu

Mantorok said:
No, it's a v2.0 control.

Kev
 
M

Mantorok

Juan T. Llibre said:
re:

Is it ? I can't find it in my 2.0 documentation,
nor on the online msdn2 docs. Would you post an online reference ?

I know it's a Display mode for the <asp:ValidationSummary control :
DisplayMode="BulletList | List ( but that works in v 1.1, too )
or, more properly, it's one of the Members of the DisplayMode
Enumeration ( the others are "List" and "SingleParagraph ).

I thought it could be a control which Dino Esposito authored :
http://www.code-magazine.com/article.aspx?quickid=0309051&page=2

Oops, I meant BulletedList....

Kev
 
E

Eliyahu Goldin

Kev,

You need to attach client-side events to the control. You need to understand
what HTML elements the control renders as and how to get to the elements
from server code.

Eliyahu
 
E

Eliyahu Goldin

Look at Attributes property. You need to know what client event you want to
handle and set the attribute for this event to the name of a javascript
function that will handle it.:

myList.Attributes["<client event>"]="handleTheEvent();";

Again, you need to find out what html tag the BulletedList is rendered as
and what event you need to handle for this tag.

Eliyahu
 

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

No members online now.

Forum statistics

Threads
473,995
Messages
2,570,236
Members
46,825
Latest member
VernonQuy6

Latest Threads

Top