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. Why my messagebox not appear?

Why my messagebox not appear?

Scheduled Pinned Locked Moved ASP.NET
question
8 Posts 5 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.
  • C Offline
    C Offline
    cheeken2u
    wrote on last edited by
    #1

    i would like to pop out a message box when the user click the delete button to ensure the user really want to delete the data, when i put the code messagebox.show(xxxxx), it cannot run, is it want to import any namespace for it ? thanks.

    Best regards, Chee ken

    _ S P C 4 Replies Last reply
    0
    • C cheeken2u

      i would like to pop out a message box when the user click the delete button to ensure the user really want to delete the data, when i put the code messagebox.show(xxxxx), it cannot run, is it want to import any namespace for it ? thanks.

      Best regards, Chee ken

      _ Offline
      _ Offline
      _AK_
      wrote on last edited by
      #2

      You can use javascript confirm for the same purpose.

      Best Regards, Apurva Kaushal

      C 1 Reply Last reply
      0
      • C cheeken2u

        i would like to pop out a message box when the user click the delete button to ensure the user really want to delete the data, when i put the code messagebox.show(xxxxx), it cannot run, is it want to import any namespace for it ? thanks.

        Best regards, Chee ken

        S Offline
        S Offline
        surshbabuk
        wrote on last edited by
        #3

        function confirm_delete() { if ( confirm( "Are you sure you want to delete the Record?") == true ) return true; else return false; } try this javascript in ur html view code and write this code in ur itemcreated event of grid try { if ( e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem ) { _myButton.Attributes.Add("onclick", "return confirm_delete();"); } } regards, suresh

        suresh babu.k

        1 Reply Last reply
        0
        • _ _AK_

          You can use javascript confirm for the same purpose.

          Best Regards, Apurva Kaushal

          C Offline
          C Offline
          cheeken2u
          wrote on last edited by
          #4

          How to write the javascript ? and i search from msdn, the sample of the messagebox is like messagebox.show() , why my web cannot run ? i so blur. Hope you can answer me , thanks !

          Best regards, Chee ken

          _ 1 Reply Last reply
          0
          • C cheeken2u

            How to write the javascript ? and i search from msdn, the sample of the messagebox is like messagebox.show() , why my web cannot run ? i so blur. Hope you can answer me , thanks !

            Best regards, Chee ken

            _ Offline
            _ Offline
            _AK_
            wrote on last edited by
            #5

            Actually when a user clicks on the delete button, it is not at all required to go to the server and show the confirmation message. Inspite you can use javascript for that it will remain there in client side only. And suresh has given the complete sample code for that.

            Best Regards, Apurva Kaushal

            1 Reply Last reply
            0
            • C cheeken2u

              i would like to pop out a message box when the user click the delete button to ensure the user really want to delete the data, when i put the code messagebox.show(xxxxx), it cannot run, is it want to import any namespace for it ? thanks.

              Best regards, Chee ken

              P Offline
              P Offline
              Paddy Boyd
              wrote on last edited by
              #6

              Your message box - it might appear on your web server...

              G 1 Reply Last reply
              0
              • C cheeken2u

                i would like to pop out a message box when the user click the delete button to ensure the user really want to delete the data, when i put the code messagebox.show(xxxxx), it cannot run, is it want to import any namespace for it ? thanks.

                Best regards, Chee ken

                C Offline
                C Offline
                cheeken2u
                wrote on last edited by
                #7

                Thanks for all helping me, i know how to do it already. ;);)

                Best regards, Chee ken

                1 Reply Last reply
                0
                • P Paddy Boyd

                  Your message box - it might appear on your web server...

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

                  You are correct in sense that the code is executed on the server, so if a message box would appear, it would appear on the server. The ASP.NET environment is specified as not having any user interface, though, so an attempt to display a message box will cause an exception.

                  --- b { font-weight: normal; }

                  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