Client-side scripting on server control

Discussion in 'ASP .Net' started by Mantorok, Jul 7, 2005.

  1. Mantorok

    Mantorok Guest

    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
    Mantorok, Jul 7, 2005
    #1
    1. Advertising

  2. Mantorok

    Mantorok Guest

    "Eliyahu Goldin" <> wrote in message
    news:%...
    > 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

    >
    > "Mantorok" <> wrote in message
    > news:dajdtd$8kq$...
    >> 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
    >>
    >>

    >
    >
    Mantorok, Jul 7, 2005
    #2
    1. Advertising

  3. Mantorok

    Mantorok Guest

    No, it's a v2.0 control.

    Kev

    "Eliyahu Goldin" <> wrote in message
    news:...
    > What is a BulletList control? Is it your custom control?
    >
    > Eliyahu
    >
    > "Mantorok" <> wrote in message
    > news:dajeh1$8vd$...
    >>
    >> "Eliyahu Goldin" <> wrote in message
    >> news:%...
    >> > 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
    >>
    >> >
    >> > "Mantorok" <> wrote in message
    >> > news:dajdtd$8kq$...
    >> >> 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
    >> >>
    >> >>
    >> >
    >> >

    >>
    >>

    >
    >
    Mantorok, Jul 7, 2005
    #3
  4. 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




    Juan T. Llibre
    ASP.NET MVP
    http://asp.net.do/foros/
    Foros de ASP.NET en Español
    Ven, y hablemos de ASP.NET...
    ======================

    "Mantorok" <> wrote in message news:dajfha$9j4$...
    > No, it's a v2.0 control.
    >
    > Kev
    >
    > "Eliyahu Goldin" <> wrote in message
    > news:...
    >> What is a BulletList control? Is it your custom control?
    >>
    >> Eliyahu
    >>
    >> "Mantorok" <> wrote in message
    >> news:dajeh1$8vd$...
    >>>
    >>> "Eliyahu Goldin" <> wrote in message
    >>> news:%...
    >>> > 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
    >>>
    >>> >
    >>> > "Mantorok" <> wrote in message
    >>> > news:dajdtd$8kq$...
    >>> >> 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
    >>> >>
    >>> >>
    >>> >
    >>> >
    >>>
    >>>

    >>
    >>

    >
    >
    Juan T. Llibre, Jul 7, 2005
    #4
  5. Mantorok

    Mantorok Guest

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

    Kev

    "Eliyahu Goldin" <> wrote in message
    news:...
    > 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" <> wrote in message
    > news:dajfha$9j4$...
    >> No, it's a v2.0 control.
    >>
    >> Kev
    >>
    >> "Eliyahu Goldin" <> wrote in message
    >> news:...
    >> > What is a BulletList control? Is it your custom control?
    >> >
    >> > Eliyahu
    >> >
    >> > "Mantorok" <> wrote in message
    >> > news:dajeh1$8vd$...
    >> >>
    >> >> "Eliyahu Goldin" <> wrote in message
    >> >> news:%...
    >> >> > 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
    >> >>
    >> >> >
    >> >> > "Mantorok" <> wrote in message
    >> >> > news:dajdtd$8kq$...
    >> >> >> 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
    >> >> >>
    >> >> >>
    >> >> >
    >> >> >
    >> >>
    >> >>
    >> >
    >> >

    >>
    >>

    >
    >
    Mantorok, Jul 7, 2005
    #5
  6. Mantorok

    Mantorok Guest

    "Juan T. Llibre" <> wrote in message
    news:...
    > 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


    Oops, I meant BulletedList....

    Kev

    >
    >
    >
    > Juan T. Llibre
    > ASP.NET MVP
    > http://asp.net.do/foros/
    > Foros de ASP.NET en Español
    > Ven, y hablemos de ASP.NET...
    > ======================
    >
    > "Mantorok" <> wrote in message
    > news:dajfha$9j4$...
    >> No, it's a v2.0 control.
    >>
    >> Kev
    >>
    >> "Eliyahu Goldin" <> wrote in message
    >> news:...
    >>> What is a BulletList control? Is it your custom control?
    >>>
    >>> Eliyahu
    >>>
    >>> "Mantorok" <> wrote in message
    >>> news:dajeh1$8vd$...
    >>>>
    >>>> "Eliyahu Goldin" <> wrote in message
    >>>> news:%...
    >>>> > 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
    >>>>
    >>>> >
    >>>> > "Mantorok" <> wrote in message
    >>>> > news:dajdtd$8kq$...
    >>>> >> 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
    >>>> >>
    >>>> >>
    >>>> >
    >>>> >
    >>>>
    >>>>
    >>>
    >>>

    >>
    >>

    >
    >
    Mantorok, Jul 7, 2005
    #6
  7. 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

    "Mantorok" <> wrote in message
    news:dajdtd$8kq$...
    > 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
    >
    >
    Eliyahu Goldin, Jul 7, 2005
    #7
  8. Ahh, the mystery unravels!
    I was scratching my head on that one... ;-)



    Juan T. Llibre
    ASP.NET MVP
    http://asp.net.do/foros/
    Foros de ASP.NET en Español
    Ven, y hablemos de ASP.NET...
    ======================

    "Mantorok" <> wrote in message news:dajh95$ac6$...
    >
    > "Juan T. Llibre" <> wrote in message
    > news:...
    >> 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

    >
    > Oops, I meant BulletedList....
    >
    > Kev
    Juan T. Llibre, Jul 7, 2005
    #8
  9. What is a BulletList control? Is it your custom control?

    Eliyahu

    "Mantorok" <> wrote in message
    news:dajeh1$8vd$...
    >
    > "Eliyahu Goldin" <> wrote in message
    > news:%...
    > > 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
    >
    > >
    > > "Mantorok" <> wrote in message
    > > news:dajdtd$8kq$...
    > >> 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
    > >>
    > >>

    > >
    > >

    >
    >
    Eliyahu Goldin, Jul 7, 2005
    #9
  10. 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" <> wrote in message
    news:dajfha$9j4$...
    > No, it's a v2.0 control.
    >
    > Kev
    >
    > "Eliyahu Goldin" <> wrote in message
    > news:...
    > > What is a BulletList control? Is it your custom control?
    > >
    > > Eliyahu
    > >
    > > "Mantorok" <> wrote in message
    > > news:dajeh1$8vd$...
    > >>
    > >> "Eliyahu Goldin" <> wrote in message
    > >> news:%...
    > >> > 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
    > >>
    > >> >
    > >> > "Mantorok" <> wrote in message
    > >> > news:dajdtd$8kq$...
    > >> >> 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
    > >> >>
    > >> >>
    > >> >
    > >> >
    > >>
    > >>

    > >
    > >

    >
    >
    Eliyahu Goldin, Jul 7, 2005
    #10
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Sumit
    Replies:
    1
    Views:
    309
    Rajesh.V
    Oct 16, 2003
  2. e
    Replies:
    2
    Views:
    407
    Charlie@CBFC
    Nov 21, 2003
  3. Brian W
    Replies:
    4
    Views:
    3,726
    Brian W
    Mar 4, 2004
  4. Kathryn
    Replies:
    9
    Views:
    188
    William Morris
    Oct 17, 2003
  5. Chris

    Client & Server side scripting

    Chris, Mar 16, 2007, in forum: ASP General
    Replies:
    1
    Views:
    194
    Tim Slattery
    Mar 16, 2007
Loading...

Share This Page