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. change the content of the page without refreshing

change the content of the page without refreshing

Scheduled Pinned Locked Moved ASP.NET
helpquestion
17 Posts 5 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.
  • S slSoftware

    hi all i have master page and the content page, in my content page i show some product details in the gridview.there will be more product in the future, so i need to do is show some of product time to time without refresh the page (Asynchronously), i tried with using XMLHttpRequest request but how can set the timeout period for that, it should change details each 1 min in the page. Pls help me to do this, What is the best way to do this Thanks

    S Offline
    S Offline
    SeMartens
    wrote on last edited by
    #2

    Sounds like the perfect use-case for AJAX...http://www.asp.net/ajax/[^]

    It's not a bug, it's a feature! Check out my CodeProject article Permission-by-aspect. Me in Softwareland.

    S 1 Reply Last reply
    0
    • S SeMartens

      Sounds like the perfect use-case for AJAX...http://www.asp.net/ajax/[^]

      It's not a bug, it's a feature! Check out my CodeProject article Permission-by-aspect. Me in Softwareland.

      S Offline
      S Offline
      slSoftware
      wrote on last edited by
      #3

      hi is there any control to do that in ajax, becous i want refresh those product details without any interact(without any user click any button).its should change the content automatically. Pls reply to me this bit urgent. Thanks

      A 1 Reply Last reply
      0
      • S slSoftware

        hi all i have master page and the content page, in my content page i show some product details in the gridview.there will be more product in the future, so i need to do is show some of product time to time without refresh the page (Asynchronously), i tried with using XMLHttpRequest request but how can set the timeout period for that, it should change details each 1 min in the page. Pls help me to do this, What is the best way to do this Thanks

        B Offline
        B Offline
        Blue_Boy
        wrote on last edited by
        #4

        Explore UpdatePanel and Timer controls of Ajax and that will do your trick.


        I Love T-SQL "Don't torture yourself,let the life to do it for you." If my post helps you kindly save my time by voting my post.

        S 1 Reply Last reply
        0
        • S slSoftware

          hi all i have master page and the content page, in my content page i show some product details in the gridview.there will be more product in the future, so i need to do is show some of product time to time without refresh the page (Asynchronously), i tried with using XMLHttpRequest request but how can set the timeout period for that, it should change details each 1 min in the page. Pls help me to do this, What is the best way to do this Thanks

          A Offline
          A Offline
          Abhijit Jana
          wrote on last edited by
          #5

          I am agree what Blue_Boy suggested. You have to use AjaX Update Panel and TimerControl. Bellow if the codesnippet, where I am updating the lblComments Value after a specific time <asp:Timer ID="Timer1" runat="server" Interval="1000" OnTick="Timer_Tick">                                  </asp:Timer>                  <asp:UpdatePanel ID="UpdatePanel1" runat="server">                      <Triggers>                            <asp:AsyncPostBackTrigger ControlID="Timer1" />                      </Triggers>                            <ContentTemplate>                                  <asp:Label ID="lblComments" runat="server"></asp:Label>                         </ContentTemplate>                </asp:UpdatePanel> In the code behind protected void Timer_Tick(object sender, EventArgs e)       {                   // Set the label content data.       }

          cheers, Abhijit CodeProject MVP Web Site:abhijitjana.net View My Recent Article

          B S 2 Replies Last reply
          0
          • S slSoftware

            hi is there any control to do that in ajax, becous i want refresh those product details without any interact(without any user click any button).its should change the content automatically. Pls reply to me this bit urgent. Thanks

            A Offline
            A Offline
            Abhijit Jana
            wrote on last edited by
            #6

            indSoftware wrote:

            is there any control to do that in ajax, becous i want refresh those product details without any interact(without any user click any button).

            Yes ! Ajax Timer Control and Update Panel. Have a look on my reply for details !

            cheers, Abhijit CodeProject MVP Web Site:abhijitjana.net View My Recent Article

            S 1 Reply Last reply
            0
            • A Abhijit Jana

              I am agree what Blue_Boy suggested. You have to use AjaX Update Panel and TimerControl. Bellow if the codesnippet, where I am updating the lblComments Value after a specific time <asp:Timer ID="Timer1" runat="server" Interval="1000" OnTick="Timer_Tick">                                  </asp:Timer>                  <asp:UpdatePanel ID="UpdatePanel1" runat="server">                      <Triggers>                            <asp:AsyncPostBackTrigger ControlID="Timer1" />                      </Triggers>                            <ContentTemplate>                                  <asp:Label ID="lblComments" runat="server"></asp:Label>                         </ContentTemplate>                </asp:UpdatePanel> In the code behind protected void Timer_Tick(object sender, EventArgs e)       {                   // Set the label content data.       }

              cheers, Abhijit CodeProject MVP Web Site:abhijitjana.net View My Recent Article

              B Offline
              B Offline
              Blue_Boy
              wrote on last edited by
              #7

              Good example to get clue for him/her. Steps will be: 1 GridView inside UpdatePanel 2 TimerControl interval = 1minute 3 In Tick event of Timer bind GridView with select statement which is ordered by column's desceding That's all.


              I Love T-SQL "Don't torture yourself,let the life to do it for you." If my post helps you kindly save my time by voting my post.

              A 1 Reply Last reply
              0
              • B Blue_Boy

                Explore UpdatePanel and Timer controls of Ajax and that will do your trick.


                I Love T-SQL "Don't torture yourself,let the life to do it for you." If my post helps you kindly save my time by voting my post.

                S Offline
                S Offline
                slSoftware
                wrote on last edited by
                #8

                hii first of all i thank you very much for ur consider, yes this is wht i need. but i hope to show some sliding way like using javascript when changing my content, i think i cant do that since im using this thanks again freind

                1 Reply Last reply
                0
                • A Abhijit Jana

                  indSoftware wrote:

                  is there any control to do that in ajax, becous i want refresh those product details without any interact(without any user click any button).

                  Yes ! Ajax Timer Control and Update Panel. Have a look on my reply for details !

                  cheers, Abhijit CodeProject MVP Web Site:abhijitjana.net View My Recent Article

                  S Offline
                  S Offline
                  slSoftware
                  wrote on last edited by
                  #9

                  hii Yes that right, this is working. thankss very much. by the way cant we do that usign XMLHttpRequest, becous i think its light weight to the page also,this is just have a idea. Thanks again

                  A 1 Reply Last reply
                  0
                  • B Blue_Boy

                    Good example to get clue for him/her. Steps will be: 1 GridView inside UpdatePanel 2 TimerControl interval = 1minute 3 In Tick event of Timer bind GridView with select statement which is ordered by column's desceding That's all.


                    I Love T-SQL "Don't torture yourself,let the life to do it for you." If my post helps you kindly save my time by voting my post.

                    A Offline
                    A Offline
                    Abhijit Jana
                    wrote on last edited by
                    #10

                    What is the reason ?

                    cheers, Abhijit CodeProject MVP Web Site:abhijitjana.net View My Recent Article

                    B 1 Reply Last reply
                    0
                    • A Abhijit Jana

                      I am agree what Blue_Boy suggested. You have to use AjaX Update Panel and TimerControl. Bellow if the codesnippet, where I am updating the lblComments Value after a specific time <asp:Timer ID="Timer1" runat="server" Interval="1000" OnTick="Timer_Tick">                                  </asp:Timer>                  <asp:UpdatePanel ID="UpdatePanel1" runat="server">                      <Triggers>                            <asp:AsyncPostBackTrigger ControlID="Timer1" />                      </Triggers>                            <ContentTemplate>                                  <asp:Label ID="lblComments" runat="server"></asp:Label>                         </ContentTemplate>                </asp:UpdatePanel> In the code behind protected void Timer_Tick(object sender, EventArgs e)       {                   // Set the label content data.       }

                      cheers, Abhijit CodeProject MVP Web Site:abhijitjana.net View My Recent Article

                      S Offline
                      S Offline
                      slSoftware
                      wrote on last edited by
                      #11

                      hellow Thanks this is working,

                      1 Reply Last reply
                      0
                      • S slSoftware

                        hii Yes that right, this is working. thankss very much. by the way cant we do that usign XMLHttpRequest, becous i think its light weight to the page also,this is just have a idea. Thanks again

                        A Offline
                        A Offline
                        Abhijit Jana
                        wrote on last edited by
                        #12

                        indSoftware wrote:

                        by the way cant we do that usign XMLHttpRequest

                        Yes, That because AJAX is all about XMLHttpRequest :laugh:

                        cheers, Abhijit CodeProject MVP Web Site:abhijitjana.net View My Recent Article

                        S 1 Reply Last reply
                        0
                        • A Abhijit Jana

                          What is the reason ?

                          cheers, Abhijit CodeProject MVP Web Site:abhijitjana.net View My Recent Article

                          B Offline
                          B Offline
                          Blue_Boy
                          wrote on last edited by
                          #13

                          What are you trying to say?! X|


                          I Love T-SQL "Don't torture yourself,let the life to do it for you." If my post helps you kindly save my time by voting my post.

                          A 1 Reply Last reply
                          0
                          • A Abhijit Jana

                            indSoftware wrote:

                            by the way cant we do that usign XMLHttpRequest

                            Yes, That because AJAX is all about XMLHttpRequest :laugh:

                            cheers, Abhijit CodeProject MVP Web Site:abhijitjana.net View My Recent Article

                            S Offline
                            S Offline
                            slSoftware
                            wrote on last edited by
                            #14

                            but scriptmanager holdd lots of resource of particular page, what i mean using XmlHttpRequest is i tried with small javascript function create object of XmlHttpRequest and execute the page like that, but my problem is i couldn't give interval time to execute again that page. :(

                            D 1 Reply Last reply
                            0
                            • B Blue_Boy

                              What are you trying to say?! X|


                              I Love T-SQL "Don't torture yourself,let the life to do it for you." If my post helps you kindly save my time by voting my post.

                              A Offline
                              A Offline
                              Abhijit Jana
                              wrote on last edited by
                              #15

                              Blue_Boy wrote:

                              What are you trying to say?

                              Ohh..Sorry !! I was just asking to the person who vote your message as 1, though all of your points was valid :) .

                              cheers, Abhijit CodeProject MVP Web Site:abhijitjana.net View My Recent Article

                              B 1 Reply Last reply
                              0
                              • A Abhijit Jana

                                Blue_Boy wrote:

                                What are you trying to say?

                                Ohh..Sorry !! I was just asking to the person who vote your message as 1, though all of your points was valid :) .

                                cheers, Abhijit CodeProject MVP Web Site:abhijitjana.net View My Recent Article

                                B Offline
                                B Offline
                                Blue_Boy
                                wrote on last edited by
                                #16

                                :thumbsup:

                                Abhijit Jana wrote:

                                who vote your message as 1

                                I'm glad that I can help to someone.


                                I Love T-SQL "Don't torture yourself,let the life to do it for you." If my post helps you kindly save my time by voting my post.

                                1 Reply Last reply
                                0
                                • S slSoftware

                                  but scriptmanager holdd lots of resource of particular page, what i mean using XmlHttpRequest is i tried with small javascript function create object of XmlHttpRequest and execute the page like that, but my problem is i couldn't give interval time to execute again that page. :(

                                  D Offline
                                  D Offline
                                  DoctorMick
                                  wrote on last edited by
                                  #17

                                  You could quite easily do it using a javascript timer to control requesting every minute.

                                  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