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. Session Problem

Session Problem

Scheduled Pinned Locked Moved ASP.NET
questionsysadminhelp
6 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.
  • P Offline
    P Offline
    pra chaudhari
    wrote on last edited by
    #1

    hi function window.onunload() { if (window.event.clientX < 0 && window.event.clientY < 0) { //call Session.Abandon() } } in above funcion i am check browser closed button is press or not when button is press i want to close the session just like a Session.Abandon()(server side function). and second question is my project above 200 web form are there and every page redirect to another page so how can i used above code only single time

    A 1 Reply Last reply
    0
    • P pra chaudhari

      hi function window.onunload() { if (window.event.clientX < 0 && window.event.clientY < 0) { //call Session.Abandon() } } in above funcion i am check browser closed button is press or not when button is press i want to close the session just like a Session.Abandon()(server side function). and second question is my project above 200 web form are there and every page redirect to another page so how can i used above code only single time

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

      You can do one thing

      if(window.event.clientX < 0 && window.event.clientY <0)
      {
      window.open("CloseSession.aspx", "OpenWindow_Close_Session",'left=12000,top=1200,width=10,height=1');
      }

      In CloseSession.aspx Page Load Do the server side task and make it self.Close();

      protected void Page_Load(object sender, EventArgs e)
      {
      Session.Abandon();
      //Close the popup window
      string strPopupScript = "self.close();";
      Page.ClientScript.RegisterStartupScript(typeof(Page), "PopUpScript", strPopupScript);
      }

      Hope this will help you.

      cheers, Abhijit CodeProject MVP

      P 1 Reply Last reply
      0
      • A Abhijit Jana

        You can do one thing

        if(window.event.clientX < 0 && window.event.clientY <0)
        {
        window.open("CloseSession.aspx", "OpenWindow_Close_Session",'left=12000,top=1200,width=10,height=1');
        }

        In CloseSession.aspx Page Load Do the server side task and make it self.Close();

        protected void Page_Load(object sender, EventArgs e)
        {
        Session.Abandon();
        //Close the popup window
        string strPopupScript = "self.close();";
        Page.ClientScript.RegisterStartupScript(typeof(Page), "PopUpScript", strPopupScript);
        }

        Hope this will help you.

        cheers, Abhijit CodeProject MVP

        P Offline
        P Offline
        pra chaudhari
        wrote on last edited by
        #3

        but sir i cannot put this code my above 200 web page :((

        A Y 2 Replies Last reply
        0
        • P pra chaudhari

          but sir i cannot put this code my above 200 web page :((

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

          So you don't have master page ?

          cheers, Abhijit CodeProject MVP

          1 Reply Last reply
          0
          • P pra chaudhari

            but sir i cannot put this code my above 200 web page :((

            Y Offline
            Y Offline
            Yusuf
            wrote on last edited by
            #5

            you don't have to. Another alternative is create web handler page (ashx page) put the functionality Abhijit provided in the ProcessRequest call it using ajax.

            Yusuf Oh didn't you notice, analogous to square roots, they recently introduced rectangular, circular, and diamond roots to determine the size of the corresponding shapes when given the area. Luc Pattyn[^]

            A 1 Reply Last reply
            0
            • Y Yusuf

              you don't have to. Another alternative is create web handler page (ashx page) put the functionality Abhijit provided in the ProcessRequest call it using ajax.

              Yusuf Oh didn't you notice, analogous to square roots, they recently introduced rectangular, circular, and diamond roots to determine the size of the corresponding shapes when given the area. Luc Pattyn[^]

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

              Yup Excelent... That is the best option, if you don't have the master page you can simply do it using handler other wise write the same in master page. :)

              cheers, Abhijit CodeProject MVP

              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