Run code while Timer is running


I have an website, which shows images of venues in a GridView. I have 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 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()
            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"
                oNextNumber = intLast + 1
                Me.Image1.ImageUrl = "~/Images_Slide2/" & oNextNumber.ToString & ".jpg"
                Me.lblImageNumber.Text = oNextNumber.ToString
            End If

        Catch ex As Exception
        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.

This sort of image juggling is usually done in JavaScript
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
The problem with current approach is that a request may be already in progress when you try to refresh the grid.

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
Easy slider
<html xmlns="">
    <title>Easy slider</title>
    <script type="text/javascript" src=""></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*/ 
    <style type="text/css">
	.slider { clear:both; position:relative; height:240px; width:950px; }
	.slider img { position:absolute; left:0; top:0;cursor:pointer; }
    <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" />

Open in new window

Murray BrownMicrosoft Cloud Azure/Excel Solution DeveloperAuthor Commented:
Thanks for the help
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.