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. pop-up message

pop-up message

Scheduled Pinned Locked Moved ASP.NET
javascript
20 Posts 8 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.
  • V Vanamaindia

    It's working ,Now I'm checked it in My prgm

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

    where shud i give tat, inside code-behind or inline html

    Thanks in advance, Priya.

    V 1 Reply Last reply
    0
    • P Priya S

      Page.ClientScript.RegisterStartupScript(this.GetType(), "pop-up", "javascript: return window.alert('Agree Terms & Conditions to proceed');"); this code just writes whatever in the last parameter like: javascript: return window.alert('Agree Terms & Conditions to proceed'); i need to pop-up

      Thanks in advance, Priya.

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

      For something like this you should use a confirm dialog rather than an alert. Confirm gives you the chance to handle yes and no responses differently. I.E No to agreeing with terms, exits site, yes continues.


      only two letters away from being an asset

      1 Reply Last reply
      0
      • P Priya S

        i want pop-up to be displayed, if user not checking the checkbox

        Thanks in advance, Priya.

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

        Priya Cool wrote:

        want pop-up to be displayed, if user not checking the checkbox

        Your question is not explaining any thing related to popup. Do you mean a confirmation message or a popup window ? If it is a confirmation message, Parvej's method is the best


        My Website | Ask smart questions

        P 1 Reply Last reply
        0
        • P Priya S

          where shud i give tat, inside code-behind or inline html

          Thanks in advance, Priya.

          V Offline
          V Offline
          Vanamaindia
          wrote on last edited by
          #12

          Response.write() is working in Code behind Only.So Place that coe in CodeBehind

          P 1 Reply Last reply
          0
          • P Priya S

            Page.ClientScript.RegisterStartupScript(this.GetType(), "pop-up", "javascript: return window.alert('Agree Terms & Conditions to proceed');"); this code just writes whatever in the last parameter like: javascript: return window.alert('Agree Terms & Conditions to proceed'); i need to pop-up

            Thanks in advance, Priya.

            P Offline
            P Offline
            Paras Kaneriya
            wrote on last edited by
            #13

            Priya Cool wrote:

            Page.ClientScript.RegisterStartupScript(this.GetType(), "pop-up", "javascript: return window.alert('Agree Terms & Conditions to proceed');");

            I think this will run when page will be loaded i.e. alert will be displayed as soon as the page will be loaded to the browser

            Paras Kaneriya
            The difference between genius and stupidity is that genius has its limits.

            P 1 Reply Last reply
            0
            • P Paras Kaneriya

              Priya Cool wrote:

              Page.ClientScript.RegisterStartupScript(this.GetType(), "pop-up", "javascript: return window.alert('Agree Terms & Conditions to proceed');");

              I think this will run when page will be loaded i.e. alert will be displayed as soon as the page will be loaded to the browser

              Paras Kaneriya
              The difference between genius and stupidity is that genius has its limits.

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

              i tried this, not pop-up ing, just like that it writes, that too as: javascript: return window.alert('Agree Terms & Conditions to proceed');

              Thanks in advance, Priya.

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

                Priya Cool wrote:

                want pop-up to be displayed, if user not checking the checkbox

                Your question is not explaining any thing related to popup. Do you mean a confirmation message or a popup window ? If it is a confirmation message, Parvej's method is the best


                My Website | Ask smart questions

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

                i want pop-up message that too with Page.ClientScript.RegisterStartupScript(this.GetType(), "pop-up", "javascript: return window.alert('Agree Terms & Conditions to proceed');");

                Thanks in advance, Priya.

                1 Reply Last reply
                0
                • V Vanamaindia

                  Response.write() is working in Code behind Only.So Place that coe in CodeBehind

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

                  nothing happens

                  Thanks in advance, Priya.

                  1 Reply Last reply
                  0
                  • P Priya S

                    i tried this, not pop-up ing, just like that it writes, that too as: javascript: return window.alert('Agree Terms & Conditions to proceed');

                    Thanks in advance, Priya.

                    B Offline
                    B Offline
                    bhavesh3184
                    wrote on last edited by
                    #17

                    why want return value of this alert? if u need return value then use confirm dialogue try this if your prob not solved then please explain me your exact prob please Page.ClientScript.RegisterStartupScript(this.GetType(), "pop-up", "doit();"); function doit() { if(window.confirm('Agree Terms & Conditions to proceed')) { //alert('OK'); return true; } else { // alert('Cancel'); return false; } } THANKS

                    P 1 Reply Last reply
                    0
                    • B bhavesh3184

                      why want return value of this alert? if u need return value then use confirm dialogue try this if your prob not solved then please explain me your exact prob please Page.ClientScript.RegisterStartupScript(this.GetType(), "pop-up", "doit();"); function doit() { if(window.confirm('Agree Terms & Conditions to proceed')) { //alert('OK'); return true; } else { // alert('Cancel'); return false; } } THANKS

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

                      i tried, it says 'function' not found.

                      Thanks in advance, Priya.

                      B 1 Reply Last reply
                      0
                      • P Priya S

                        i tried, it says 'function' not found.

                        Thanks in advance, Priya.

                        B Offline
                        B Offline
                        bhavesh3184
                        wrote on last edited by
                        #19

                        can please send me page in which you have written code and what u required my email id is = bhavesh3184@gmail.com thanks

                        1 Reply Last reply
                        0
                        • P Priya S

                          Page.ClientScript.RegisterStartupScript(this.GetType(), "pop-up", "javascript: return window.alert('Agree Terms & Conditions to proceed');"); this code just writes whatever in the last parameter like: javascript: return window.alert('Agree Terms & Conditions to proceed'); i need to pop-up

                          Thanks in advance, Priya.

                          G Offline
                          G Offline
                          Guffa
                          wrote on last edited by
                          #20

                          This is how it should look: Page.ClientScript.RegisterStartupScript(this.GetType(), "pop-up", "window.alert('Agree Terms & Conditions to proceed');", true); The last parameter determines that a script tag is added around the code. The javascript: protocol is only used when you put Javascript code in an URL. If you use it anywhere else, it's treated as a label instead. You only use return when returning from a function.

                          --- single minded; short sighted; long gone;

                          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