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. One simple question on Page Refreshing

One simple question on Page Refreshing

Scheduled Pinned Locked Moved ASP.NET
questioncsharpasp-nethelptutorial
11 Posts 3 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.
  • X Offline
    X Offline
    xbiplav
    wrote on last edited by
    #1

    Hi all the lovely people out there, I am just a beginner in Asp.net. I have a page which has a login link. When i click the login link it pops up a small window where he can login. But after successful login I do not know how to refresh the original page and change the login label to logout. Can you guys help me out?

    C A 2 Replies Last reply
    0
    • X xbiplav

      Hi all the lovely people out there, I am just a beginner in Asp.net. I have a page which has a login link. When i click the login link it pops up a small window where he can login. But after successful login I do not know how to refresh the original page and change the login label to logout. Can you guys help me out?

      C Offline
      C Offline
      Christian Graus
      wrote on last edited by
      #2

      You can write javascript in a popup page to refer to the original page and call methods in it. I used google and quickly found this[^]

      Christian Graus Driven to the arms of OSX by Vista. Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.

      X 1 Reply Last reply
      0
      • C Christian Graus

        You can write javascript in a popup page to refer to the original page and call methods in it. I used google and quickly found this[^]

        Christian Graus Driven to the arms of OSX by Vista. Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.

        X Offline
        X Offline
        xbiplav
        wrote on last edited by
        #3

        Thanks Man for your time. Also, can AJAX capable of doing such stuffs.

        C 1 Reply Last reply
        0
        • X xbiplav

          Thanks Man for your time. Also, can AJAX capable of doing such stuffs.

          C Offline
          C Offline
          Christian Graus
          wrote on last edited by
          #4

          xbiplav wrote:

          Also, can AJAX capable of doing such stuffs.

          No, of course not. Not without doing it in a convoluted and wasteful way. AJAX lets a page ask the server for data without doing a full refresh. You'd have to have both pages polling with AJAX to find out if the event had occured. That would be a total waste of time. Just because something is sexy for the moment in the dev world, does not mean you should invent ways to use it when it's the wrong tool for the job. The ASP.NET AJAX library DOES do some stuff that has NOTHING to do with AJAX, so it may have something that will help you, but only because it's become the home of any sort of javascript coolness that MS can come up with.

          Christian Graus Driven to the arms of OSX by Vista. Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.

          X 1 Reply Last reply
          0
          • C Christian Graus

            xbiplav wrote:

            Also, can AJAX capable of doing such stuffs.

            No, of course not. Not without doing it in a convoluted and wasteful way. AJAX lets a page ask the server for data without doing a full refresh. You'd have to have both pages polling with AJAX to find out if the event had occured. That would be a total waste of time. Just because something is sexy for the moment in the dev world, does not mean you should invent ways to use it when it's the wrong tool for the job. The ASP.NET AJAX library DOES do some stuff that has NOTHING to do with AJAX, so it may have something that will help you, but only because it's become the home of any sort of javascript coolness that MS can come up with.

            Christian Graus Driven to the arms of OSX by Vista. Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.

            X Offline
            X Offline
            xbiplav
            wrote on last edited by
            #5

            Thank you once again. Also i want to ask you one last thing and I am sorry for my ignorance. My question is that, like in windows programming we can change the state of Form1 from Form2 by creating objects and passing messages. Similarly like in web, is it possible like we create an object of WebForm1, then pass this instance to WebForm2 and if we want to change an object's state of WebForm1(lets say a label text in WebForm1 to something) can we use that instance of Webform1 (from Webform2) and do that?

            C 1 Reply Last reply
            0
            • X xbiplav

              Thank you once again. Also i want to ask you one last thing and I am sorry for my ignorance. My question is that, like in windows programming we can change the state of Form1 from Form2 by creating objects and passing messages. Similarly like in web, is it possible like we create an object of WebForm1, then pass this instance to WebForm2 and if we want to change an object's state of WebForm1(lets say a label text in WebForm1 to something) can we use that instance of Webform1 (from Webform2) and do that?

              C Offline
              C Offline
              Christian Graus
              wrote on last edited by
              #6

              No, you can't. The web is stateless. Every postback creates a new instance of that page class, which is then destroyed when the page is sent. webform1 does NOT exist if it's not visible. There's nothing to interact with. You pass values between pages by putting them on the URL or storing them in the session. The URL way is far better, it creates pages that rebuild themselves and can be bookmarked, and does not use server resources. Sometimes, you do need to use the session tho.

              Christian Graus Driven to the arms of OSX by Vista. Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.

              X 1 Reply Last reply
              0
              • C Christian Graus

                No, you can't. The web is stateless. Every postback creates a new instance of that page class, which is then destroyed when the page is sent. webform1 does NOT exist if it's not visible. There's nothing to interact with. You pass values between pages by putting them on the URL or storing them in the session. The URL way is far better, it creates pages that rebuild themselves and can be bookmarked, and does not use server resources. Sometimes, you do need to use the session tho.

                Christian Graus Driven to the arms of OSX by Vista. Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.

                X Offline
                X Offline
                xbiplav
                wrote on last edited by
                #7

                Thank u man. U seem to have good knowledge of web technology. I appreciate your time.

                C 1 Reply Last reply
                0
                • X xbiplav

                  Thank u man. U seem to have good knowledge of web technology. I appreciate your time.

                  C Offline
                  C Offline
                  Christian Graus
                  wrote on last edited by
                  #8

                  Glad to help :-) It's customary if the answers helped to mark them with the 'good answer' button or the '5'.

                  Christian Graus Driven to the arms of OSX by Vista. Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.

                  X 1 Reply Last reply
                  0
                  • C Christian Graus

                    Glad to help :-) It's customary if the answers helped to mark them with the 'good answer' button or the '5'.

                    Christian Graus Driven to the arms of OSX by Vista. Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.

                    X Offline
                    X Offline
                    xbiplav
                    wrote on last edited by
                    #9

                    Here you go..I gave you 5...Yayyy....

                    1 Reply Last reply
                    0
                    • X xbiplav

                      Hi all the lovely people out there, I am just a beginner in Asp.net. I have a page which has a login link. When i click the login link it pops up a small window where he can login. But after successful login I do not know how to refresh the original page and change the login label to logout. Can you guys help me out?

                      A Offline
                      A Offline
                      anumole mathew
                      wrote on last edited by
                      #10

                      When ever you open a pop window , you can get the reference of the parent. Once the login is successful, you cna pass a success indicator to the parent. In the function where you might have called the pop up window, check for this indicator and then check the Text to Log Out at the client side using javascript.

                      X 1 Reply Last reply
                      0
                      • A anumole mathew

                        When ever you open a pop window , you can get the reference of the parent. Once the login is successful, you cna pass a success indicator to the parent. In the function where you might have called the pop up window, check for this indicator and then check the Text to Log Out at the client side using javascript.

                        X Offline
                        X Offline
                        xbiplav
                        wrote on last edited by
                        #11

                        Hi anumole, I am sorry but I did not get it. Even a pseudocode will help if you could demonstrate a bit. Thank You!

                        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