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. Page.RegisterStartupScript

Page.RegisterStartupScript

Scheduled Pinned Locked Moved ASP.NET
tutorialquestion
5 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.
  • M Offline
    M Offline
    Member 3879881
    wrote on last edited by
    #1

    Hi guys, Very good morning to all..., i have a page in tht one image click i opened a pop up window..., while openeing the popup window i have checked the session of "userid"..., if session is expired i have to close the popup window and the parent page has to redirect to login page..., so the popup window page i have declared in page load like this..., _UserID = Session["UserID"] == null ? string.Empty : Session["UserID"].ToString().Trim(); if (_UserID == string.Empty) { System.Text.StringBuilder sb = new System.Text.StringBuilder(); sb.Append(""); sb.Append("window.opener.location.href='/LoginPT.aspx?msg=se"); sb.Append("';"); sb.Append("self.close();"); sb.Append(""); Page.RegisterStartupScript("FocusScript", sb.ToString()); } but this is not working for me..., plz guide me to solve this..., Thanks & Regards, Member 3879881, please don't forget to vote on the post

    A N 2 Replies Last reply
    0
    • M Member 3879881

      Hi guys, Very good morning to all..., i have a page in tht one image click i opened a pop up window..., while openeing the popup window i have checked the session of "userid"..., if session is expired i have to close the popup window and the parent page has to redirect to login page..., so the popup window page i have declared in page load like this..., _UserID = Session["UserID"] == null ? string.Empty : Session["UserID"].ToString().Trim(); if (_UserID == string.Empty) { System.Text.StringBuilder sb = new System.Text.StringBuilder(); sb.Append(""); sb.Append("window.opener.location.href='/LoginPT.aspx?msg=se"); sb.Append("';"); sb.Append("self.close();"); sb.Append(""); Page.RegisterStartupScript("FocusScript", sb.ToString()); } but this is not working for me..., plz guide me to solve this..., Thanks & Regards, Member 3879881, please don't forget to vote on the post

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

      Do you have script manager on the page ?

      Cheers ! Abhijit Jana | My Blog | @Twitter | Disclaimer

      :bob: Indian CodeProject Members Meet 2010 - Nominate Now :bob:

      N 1 Reply Last reply
      0
      • M Member 3879881

        Hi guys, Very good morning to all..., i have a page in tht one image click i opened a pop up window..., while openeing the popup window i have checked the session of "userid"..., if session is expired i have to close the popup window and the parent page has to redirect to login page..., so the popup window page i have declared in page load like this..., _UserID = Session["UserID"] == null ? string.Empty : Session["UserID"].ToString().Trim(); if (_UserID == string.Empty) { System.Text.StringBuilder sb = new System.Text.StringBuilder(); sb.Append(""); sb.Append("window.opener.location.href='/LoginPT.aspx?msg=se"); sb.Append("';"); sb.Append("self.close();"); sb.Append(""); Page.RegisterStartupScript("FocusScript", sb.ToString()); } but this is not working for me..., plz guide me to solve this..., Thanks & Regards, Member 3879881, please don't forget to vote on the post

        N Offline
        N Offline
        Not Active
        wrote on last edited by
        #3

        Have you debugged it? Is the if condition being meet? Is the script being written and just not executed?


        I know the language. I've read a book. - _Madmatt

        1 Reply Last reply
        0
        • A Abhijit Jana

          Do you have script manager on the page ?

          Cheers ! Abhijit Jana | My Blog | @Twitter | Disclaimer

          :bob: Indian CodeProject Members Meet 2010 - Nominate Now :bob:

          N Offline
          N Offline
          Not Active
          wrote on last edited by
          #4

          ScriptManager is irrelevant. It is for AJAX support and is not necessary for injecting normal JavaScript into a page.


          I know the language. I've read a book. - _Madmatt

          A 1 Reply Last reply
          0
          • N Not Active

            ScriptManager is irrelevant. It is for AJAX support and is not necessary for injecting normal JavaScript into a page.


            I know the language. I've read a book. - _Madmatt

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

            Mark Nischalke wrote:

            ScriptManager is irrelevant.

            I was asking becasue, If he has ScriptManager on the page, then the code he has written won't work.

            Mark Nischalke wrote:

            It is for AJAX support and is not necessary for injecting normal JavaScript into a page.

            :)

            Cheers ! Abhijit Jana | My Blog | @Twitter | Disclaimer

            :bob: Indian CodeProject Members Meet 2010 - Nominate Now :bob:

            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