Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > reading attributes from javascript, how?

Reply
Thread Tools

reading attributes from javascript, how?

 
 
Jeff
Guest
Posts: n/a
 
      05-23-2009
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?


 
Reply With Quote
 
 
 
 
Jeff
Guest
Posts: n/a
 
      05-23-2009
I've done a workaround


"Jeff" <(E-Mail Removed)> wrote in message
news:%(E-Mail Removed)...
> 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?
>



 
Reply With Quote
 
 
 
 
Alexey Smirnov
Guest
Posts: n/a
 
      05-23-2009
On May 23, 3:04*am, "Jeff" <(E-Mail Removed)> 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
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
data attributes override method attributes? Jayden Python 16 09-29-2012 03:20 AM
attributes ala java annotations or .Net attributes? Kyle Schmitt Ruby 3 07-24-2007 07:48 PM
class attributes & data attributes james_027 Python 2 06-20-2007 03:12 PM
WebControl.Attributes.Add and custom attributes P4trykx ASP .Net 2 01-31-2007 04:33 PM
Parse reserved attributes as normal attributes Max XML 1 09-22-2006 12:04 PM



Advertisments