Link to home
Start Free TrialLog in
Avatar of adimit
adimit

asked on

changing image on update panel using a timer (blinking)

Hello

I have a timer attached to an update panel. In one instance I want to perform a blink type function on an image:
example
if image1.imageurl = "red.jpg" then imageurl ="black.jpg" esle image1.imageurl = "red.jpg"

my problem is that the first time the timer executes it changes the image to black.jpg, but each time the timer runs image1.imageurl is always equal to red.jpg even though it is visually black.jpg. What am I doing wrong?
SOLUTION
Avatar of Omego2K
Omego2K
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of adimit
adimit

ASKER

If fifoValues(tempInt) = True Then
                            If myControl.imageurl = formula.greenInterlockImage Or myControl.imageurl = formula.redInterlockImage Then
                                myControl.imageurl = formula.blinkInterlockImage
                            Else
                                If ilkValues(tempInt) = False Then
                                    myControl.imageurl = formula.greenInterlockImage
                                Else
                                    myControl.imageurl = formula.redInterlockImage
                                End If
                            End If
                        End If
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of adimit

ASKER

it is inside the update panel. It is changed by a timer. The aspx code is huge.
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of adimit

ASKER

below is the emtire for loop. Mycontrol is of type image when evaluated (verified through breakpoints)
 For Each myControl In UpdatePanel761.ContentTemplateContainer.Controls
                    If valid.eliminateNullString(myControl.id).ToUpper.Trim = (interlockObjects(x).ID).ToUpper Then
                        '-------------------------------------------------------------
                        codePointer = "Set Interlock Object properties"
                        '-------------------------------------------------------------                      
                        myControl.ToolTip = interlockObjects(x).ToolTip
                        'find correspondig interlockbit for x
                        tempStr = valid.eliminateNullString(formula.interlockOrder(Session("IntType"), x))
                        If tempstr.Length = 0 Then Exit For
                        tempInt = tempStr.IndexOf(".", 0)
                        tempInt = tempStr.IndexOf(".", tempInt + 1)
                        tempStr = tempStr.Substring(tempInt + 1)
                        '-------------------------------------------------------------
                        codePointer = "Set Interlock Object properties - Determining interlock bitname to animante"
                        '-------------------------------------------------------------
                        tempInt = tempStr
                        If ilkValues(tempInt) = False Then
                            myControl.imageurl = formula.greenInterlockImage
                            'myControl.tooltip = valid.eliminateNullString(formula.interlockOrder(Session("IntType"), tempInt))
                        Else
                            myControl.imageurl = formula.redInterlockImage
                            'myControl.tooltip = valid.eliminateNullString(formula.interlockOrder(Session("IntType"), tempInt))
                        End If

                        '-------------------------------------------------------------------------------------------
                        codePointer = "Set Interlock Object properties - Animate Fifo (blinking)"
                        '--------------------------------------------------------------------------------------------
                        If fifoValues(tempInt) = True Then
                            If myControl.imageurl = formula.greenInterlockImage Or myControl.imageurl = formula.redInterlockImage Then
                                myControl.imageurl = formula.blinkInterlockImage
                            Else
                                If ilkValues(tempInt) = False Then
                                    myControl.imageurl = formula.greenInterlockImage
                                Else
                                    myControl.imageurl = formula.redInterlockImage
                                End If
                            End If
                        End If
                        myControl.visible = True
                        Count = Count + 1
                    End If
                    If valid.eliminateNullString(myControl.id).ToUpper.Trim = (labelObjects(x).ID).ToUpper Then
                        '-------------------------------------------------------------------------------
                        codePointer = "Set Label properties"
                        '-------------------------------------------------------------------------------
                        myControl.Text = labelObjects(x).Text
                        myControl.ForeColor = labelObjects(x).ForeColor
                        myControl.visible = True
                        Count = Count + 1
                    End If
                    If valid.eliminateNullString(myControl.id).ToUpper.Trim = (labelNumObjects(x).ID).ToUpper Then
                        '-------------------------------------------------------------------------------
                        codePointer = "Set Label num properties"
                        '-------------------------------------------------------------------------------
                        myControl.Text = labelNumObjects(x).Text
                        myControl.ForeColor = labelNumObjects(x).ForeColor
                        myControl.visible = True
                        Count = Count + 1
                    End If
                    If Count = 3 Then Exit For
                Next
            Next x
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of adimit

ASKER

In the code it is always formula.redInterlockImage  when it should be formula.blinkinterlockimage. Visually it is formula.blinkinterlockimage. By code i mean if I place a breakpoint and see the imageurl property in a watch window it is always formula.redinterlockimage.
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of adimit

ASKER

I enabled the viewstate property on the image, thinking that that might be the problem (I had originally disabled it). That didn't solve the problem. How do i make the view state field change?
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of adimit

ASKER

how would i change the viewstate for a particular object?
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of adimit

ASKER

->Since the viewstate hidden field is outside the update panel it doesn't change, unless the update panel changes it, which I don't think it does

How does the update panel change the view state field? all code is being executed by a timer that updates the update panel
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial