reading attributes from javascript, how?

Discussion in 'ASP .Net' started by Jeff, May 23, 2009.

  1. Jeff

    Jeff Guest

    hi

    asp.net 3.5

    I have a few ImageButtons on my webpage. On those buttons I want to
    implement image swapping...I've done image swapping before but this is more
    difficult for me to solve... - the image can change cause of .net code
    also...

    when a imagebutton is clicked then it's image is changed. In addition when
    hovering mouse over a button then image is changed also.
    on mouseout it swaps back to the previous image, but here is the problem it
    should not swap back to the previous image if imagebutton is clicked.... So
    I'm looking for a way to add a attribute on a imagebutton (when imagebutton
    is clicked - .net code) which I later can test on inside the javascript

    any suggestions?
    Jeff, May 23, 2009
    #1
    1. Advertising

  2. Jeff

    Jeff Guest

    I've done a workaround


    "Jeff" <> wrote in message
    news:%...
    > hi
    >
    > asp.net 3.5
    >
    > I have a few ImageButtons on my webpage. On those buttons I want to
    > implement image swapping...I've done image swapping before but this is
    > more difficult for me to solve... - the image can change cause of .net
    > code also...
    >
    > when a imagebutton is clicked then it's image is changed. In addition when
    > hovering mouse over a button then image is changed also.
    > on mouseout it swaps back to the previous image, but here is the problem
    > it should not swap back to the previous image if imagebutton is
    > clicked.... So I'm looking for a way to add a attribute on a imagebutton
    > (when imagebutton is clicked - .net code) which I later can test on inside
    > the javascript
    >
    > any suggestions?
    >
    Jeff, May 23, 2009
    #2
    1. Advertising

  3. On May 23, 3:04 am, "Jeff" <> wrote:
    > hi
    >
    > asp.net 3.5
    >
    > I have a few ImageButtons on my webpage. On those buttons I want to
    > implement image swapping...I've done image swapping before but this is more
    > difficult for me to solve... - the image can change cause of .net code
    > also...
    >
    > when a imagebutton is clicked then it's image is changed. In addition when
    > hovering mouse over a button then image is changed also.
    > on mouseout it swaps back to the previous image, but here is the problem it
    > should not swap back to the previous image if imagebutton is clicked.... So
    > I'm looking for a way to add a attribute on a imagebutton (when imagebutton
    > is clicked - .net code) which I later can test on inside the javascript
    >
    > any suggestions?


    you can always "inject" js by .net code using

    <script>
    var x = <%=Value%>
    ....

    where Value is protected or public variable from the code behind
    Alexey Smirnov, May 23, 2009
    #3
    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. Max
    Replies:
    1
    Views:
    468
    Joe Kesselman
    Sep 22, 2006
  2. P4trykx
    Replies:
    2
    Views:
    1,786
    bruce barker
    Jan 31, 2007
  3. james_027

    class attributes & data attributes

    james_027, Jun 20, 2007, in forum: Python
    Replies:
    2
    Views:
    358
    Bruno Desthuilliers
    Jun 20, 2007
  4. Kyle Schmitt
    Replies:
    3
    Views:
    177
    Kyle Schmitt
    Jul 24, 2007
  5. Jayden
    Replies:
    16
    Views:
    468
    Steven D'Aprano
    Sep 29, 2012
Loading...

Share This Page