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
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. Web Development
  3. ASP.NET
  4. how to pop-up a window in asp.net

how to pop-up a window in asp.net

Scheduled Pinned Locked Moved ASP.NET
csharpasp-nettutorial
8 Posts 5 Posters 2 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
    Priya S
    wrote on last edited by
    #1

    :doh:

    Thanks&Regards, Priya.

    T N N 3 Replies Last reply
    0
    • P Priya S

      :doh:

      Thanks&Regards, Priya.

      T Offline
      T Offline
      Talal Sultan
      wrote on last edited by
      #2

      The only way is to use Javascript on the client side. You can add an attribute to do that to the ASP.NET control in Page_Load for example. Assuming you have a button btnSubmit, you would do something like:

      if (!IsPostBack)
      {
      btnSubmit.Attributes.Add("onclick","return confirm('Submit report?');");
      }

      The first parameter of the Attributes.Add method is the clientside event, the second parameter is any Javascript code you would like to execute. Talal

      -- If this is a post that has been helpful to you, please vote for it. Thank you! "Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning." --Rich Cook

      N 1 Reply Last reply
      0
      • P Priya S

        :doh:

        Thanks&Regards, Priya.

        N Offline
        N Offline
        N a v a n e e t h
        wrote on last edited by
        #3

        ASP.NET can't do anything on popping up a window. It can be done by client side scripting like Javascript. Try window.open("pagename").


        My Website | Ask smart questions

        1 Reply Last reply
        0
        • T Talal Sultan

          The only way is to use Javascript on the client side. You can add an attribute to do that to the ASP.NET control in Page_Load for example. Assuming you have a button btnSubmit, you would do something like:

          if (!IsPostBack)
          {
          btnSubmit.Attributes.Add("onclick","return confirm('Submit report?');");
          }

          The first parameter of the Attributes.Add method is the clientside event, the second parameter is any Javascript code you would like to execute. Talal

          -- If this is a post that has been helpful to you, please vote for it. Thank you! "Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning." --Rich Cook

          N Offline
          N Offline
          N a v a n e e t h
          wrote on last edited by
          #4

          Talal,

          Talal Sultan wrote:

          btnSubmit.Attributes.Add("onclick","return confirm('Submit report?');");

          Question was how to pop up a window. But this is different :confused:. Am I missing something ?:confused:


          My Website | Ask smart questions

          T J 2 Replies Last reply
          0
          • N N a v a n e e t h

            Talal,

            Talal Sultan wrote:

            btnSubmit.Attributes.Add("onclick","return confirm('Submit report?');");

            Question was how to pop up a window. But this is different :confused:. Am I missing something ?:confused:


            My Website | Ask smart questions

            T Offline
            T Offline
            Talal Sultan
            wrote on last edited by
            #5

            ooops, you're right. Popping up a message box is such a common question that I thought this is what the question was. Sorry my mistake :)

            -- If this is a post that has been helpful to you, please vote for it. Thank you! "Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning." --Rich Cook

            1 Reply Last reply
            0
            • P Priya S

              :doh:

              Thanks&Regards, Priya.

              N Offline
              N Offline
              nandhububbly
              wrote on last edited by
              #6

              U got Solution or not ?

              P 1 Reply Last reply
              0
              • N N a v a n e e t h

                Talal,

                Talal Sultan wrote:

                btnSubmit.Attributes.Add("onclick","return confirm('Submit report?');");

                Question was how to pop up a window. But this is different :confused:. Am I missing something ?:confused:


                My Website | Ask smart questions

                J Offline
                J Offline
                John ph
                wrote on last edited by
                #7

                jus to make the record straight btnSubmit.Attributes.Add("onclick","window.open('PagePath','WindowName','WindowAttributes');") Regards John

                1 Reply Last reply
                0
                • N nandhububbly

                  U got Solution or not ?

                  P Offline
                  P Offline
                  Priya S
                  wrote on last edited by
                  #8

                  No,i didn't get it yet. actually i would like to open calendar control in a pop-up window when user clicks a button.:confused:

                  Thanks&Regards, Priya.

                  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