Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. ASP.NET
  4. scroll posititon for div but different problem (timer is there)

scroll posititon for div but different problem (timer is there)

Scheduled Pinned Locked Moved ASP.NET
helpcssannouncementlounge
6 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • R Offline
    R Offline
    rahul_miche
    wrote on last edited by
    #1

    I have developed a chat application. i am displaying chat messages using gridview in a div.I am using gridview in update panel(ajax).With every timer_tick I update the gridview.My timer control s in control template of update panel.The problem is I have to maintain the scroll position after after timer tick event ie after the grid gets the data. I ahve altried all the options on the net.None of them is working.Help me Its urgent. This problem is buggin me alot. Here is the code .aspx ]]> Welcome to chat application <%----%>

    ]]>

    <%-- --%> <%#Eval("Chat_msgs")%>

    G 1 Reply Last reply
    0
    • R rahul_miche

      I have developed a chat application. i am displaying chat messages using gridview in a div.I am using gridview in update panel(ajax).With every timer_tick I update the gridview.My timer control s in control template of update panel.The problem is I have to maintain the scroll position after after timer tick event ie after the grid gets the data. I ahve altried all the options on the net.None of them is working.Help me Its urgent. This problem is buggin me alot. Here is the code .aspx ]]> Welcome to chat application <%----%>

      ]]>

      <%-- --%> <%#Eval("Chat_msgs")%>

      G Offline
      G Offline
      Gaurav K Singh
      wrote on last edited by
      #2

      Use this javascript code after the databind or just before the closing body tage. var objDiv = document.getElementById("div1"); objDiv.scrollTop = objDiv.scrollHeight; Use the original 'div id' in place of div1.

      The miracle is this--the more we share, the more we have.

      R 1 Reply Last reply
      0
      • G Gaurav K Singh

        Use this javascript code after the databind or just before the closing body tage. var objDiv = document.getElementById("div1"); objDiv.scrollTop = objDiv.scrollHeight; Use the original 'div id' in place of div1.

        The miracle is this--the more we share, the more we have.

        R Offline
        R Offline
        rahul_miche
        wrote on last edited by
        #3

        hey gaurav thanks for reply i was waiting for a reply no body replied i guess its not such atough question anywaz your solution is not working any other solutions. i am fed up this problem hopefuly some one can give a solution(s) thanks in adavnce

        G 1 Reply Last reply
        0
        • R rahul_miche

          hey gaurav thanks for reply i was waiting for a reply no body replied i guess its not such atough question anywaz your solution is not working any other solutions. i am fed up this problem hopefuly some one can give a solution(s) thanks in adavnce

          G Offline
          G Offline
          Gaurav K Singh
          wrote on last edited by
          #4

          oh... It should work...Because it is tested in my porject. For creating a scroll i used style="overflow:auto" in my div...

          Try it again...

          The miracle is this--the more we share, the more we have.

          R 1 Reply Last reply
          0
          • G Gaurav K Singh

            oh... It should work...Because it is tested in my porject. For creating a scroll i used style="overflow:auto" in my div...

            Try it again...

            The miracle is this--the more we share, the more we have.

            R Offline
            R Offline
            rahul_miche
            wrote on last edited by
            #5

            hey gaurav believe me its not working i tried it ..(many times now) my chat messages are going down i have drag the vertical scroll bar down to see the messages the scroll position does not remain at the same position after the timer_tick in update panel fires.... waiting for your reply Thanks in advance

            R 1 Reply Last reply
            0
            • R rahul_miche

              hey gaurav believe me its not working i tried it ..(many times now) my chat messages are going down i have drag the vertical scroll bar down to see the messages the scroll position does not remain at the same position after the timer_tick in update panel fires.... waiting for your reply Thanks in advance

              R Offline
              R Offline
              rahul_miche
              wrote on last edited by
              #6

              also sorry to disturb u alot u can try my code which i have given in first post thanks in advance tc

              1 Reply Last reply
              0
              Reply
              • Reply as topic
              Log in to reply
              • Oldest to Newest
              • Newest to Oldest
              • Most Votes


              • Login

              • Don't have an account? Register

              • Login or register to search.
              • First post
                Last post
              0
              • Categories
              • Recent
              • Tags
              • Popular
              • World
              • Users
              • Groups