ASP.net Run VB.net code while Timer is running

Hi

I have an ASP.net website, which shows images of venues in a GridView. I have VB.net code behind for buttons that refreshes the information in a different order. I have now used the code below to show alternating images.
The problem is that now that the Timer is running, my VB.net code to refresh the Gridview doesn't.
  Protected Sub Timer1_Tick(sender As Object, e As EventArgs) Handles Timer1.Tick
        Call Display_Next_Image()
    End Sub

    Sub Display_Next_Image()
        Try
            Dim intLast As Integer = CInt(Me.lblImageNumber.Text)
            Dim oNextNumber As String

            If intLast = 10 Then
                Me.Image1.ImageUrl = "~/Images_Slide2/1.jpg"

                Me.lblImageNumber.Text = "1"
            Else
                oNextNumber = intLast + 1
                Me.Image1.ImageUrl = "~/Images_Slide2/" & oNextNumber.ToString & ".jpg"
                Me.lblImageNumber.Text = oNextNumber.ToString
            End If

        Catch ex As Exception
            Response.Write(ex.Message)
        End Try
    End Sub
Murray BrownMicrosoft Cloud Azure/Excel Solution DeveloperAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

CodeCruiserCommented:
This sort of image juggling is usually done in JavaScript

http://www.menucool.com/javascript-image-slider
0
Murray BrownMicrosoft Cloud Azure/Excel Solution DeveloperAuthor Commented:
Thanks for the info. I would really like to try and sort this out with a technique that does not employ Java Script
0
CodeCruiserCommented:
The problem with current approach is that a request may be already in progress when you try to refresh the grid.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
ArkCommented:
Easy slider
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title>Easy slider</title>
    <script type="text/javascript" src="http://ajax.aspnetcdn.com/ajax/jquery/jquery-1.9.0.min.js"></script>
    <script type="text/javascript">
        $(function () {
            $('.slider img:gt(0)').hide();
            setInterval(function () { $('.slider :first-child').fadeOut(2000).next('img').fadeIn(2000).end().appendTo('.slider'); }, 5000); /*5 sec*/ 
        });
    </script>
    <style type="text/css">
	.slider { clear:both; position:relative; height:240px; width:950px; }
	.slider img { position:absolute; left:0; top:0;cursor:pointer; }
    </style>
</head>
<body>
    <div class="slider" style="margin:0 auto;">
        <img src="Images_Slide2/1.jpg" />
        <img src="Images_Slide2/2.jpg" />
        <img src="Images_Slide2/3.jpg" />
        <img src="Images_Slide2/4.jpg" />
        <img src="Images_Slide2/5.jpg" />
        <img src="Images_Slide2/6.jpg" />
        <img src="Images_Slide2/7.jpg" />
        <img src="Images_Slide2/8.jpg" />
        <img src="Images_Slide2/9.jpg" />
    </div>
</body>
</html>

Open in new window

0
Murray BrownMicrosoft Cloud Azure/Excel Solution DeveloperAuthor Commented:
Thanks for the help
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Visual Basic.NET

From novice to tech pro — start learning today.