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. Producing warning messages

Producing warning messages

Scheduled Pinned Locked Moved ASP.NET
csharptutorialasp-netquestion
7 Posts 2 Posters 1 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.
  • K Offline
    K Offline
    Kontakentee
    wrote on last edited by
    #1

    Please, I want to know how to create warning yes/no message boxes using C# and ASP.NET. For example, Are you sure you want to delete this?

    N 1 Reply Last reply
    0
    • K Kontakentee

      Please, I want to know how to create warning yes/no message boxes using C# and ASP.NET. For example, Are you sure you want to delete this?

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

      Use the JavaScript method; confirm if(confirm('Are you sure you want to delete this?')) do something


      only two letters away from being an asset

      K 1 Reply Last reply
      0
      • N Not Active

        Use the JavaScript method; confirm if(confirm('Are you sure you want to delete this?')) do something


        only two letters away from being an asset

        K Offline
        K Offline
        Kontakentee
        wrote on last edited by
        #3

        Thanks Mark. But please, explain to me how to use the confirm method. When I used it an error is displayed on compilation "The name confirm dosen't exist in the current context"?? Do I have to provide code for this method before calling it?

        N 1 Reply Last reply
        0
        • K Kontakentee

          Thanks Mark. But please, explain to me how to use the confirm method. When I used it an error is displayed on compilation "The name confirm dosen't exist in the current context"?? Do I have to provide code for this method before calling it?

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

          You use it as I've given within a JavaScript block on your page, nothing more. Perhaps you could show a sample that is giving you problems, or search this site or others for examples.


          only two letters away from being an asset

          K 1 Reply Last reply
          0
          • N Not Active

            You use it as I've given within a JavaScript block on your page, nothing more. Perhaps you could show a sample that is giving you problems, or search this site or others for examples.


            only two letters away from being an asset

            K Offline
            K Offline
            Kontakentee
            wrote on last edited by
            #5

            Hi Mark, The problem is that I'm using C# to write my code. On confirming the delete message, my program should delete all information related to a student. So I create a new SQLDataSource and then write the delete command as follows. SQLDataSource DeleteStudentInfo = new SQLDataSource(); DeleteStudentInfo.DeleteCommand = "Delete From Student Where StudentID = @StudentID"; Then I identify my delete parameters. How to insert javascript code before my C# code shown above? Thanks Mark

            N 1 Reply Last reply
            0
            • K Kontakentee

              Hi Mark, The problem is that I'm using C# to write my code. On confirming the delete message, my program should delete all information related to a student. So I create a new SQLDataSource and then write the delete command as follows. SQLDataSource DeleteStudentInfo = new SQLDataSource(); DeleteStudentInfo.DeleteCommand = "Delete From Student Where StudentID = @StudentID"; Then I identify my delete parameters. How to insert javascript code before my C# code shown above? Thanks Mark

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

              Kontakentee wrote:

              How to insert javascript code before my C# code

              You don't. JavaScript is run on the client, C# code is run on the server. I think you should reread a couple chapters in the book or ask the professor or TA for help, your missing some concepts.


              only two letters away from being an asset

              K 1 Reply Last reply
              0
              • N Not Active

                Kontakentee wrote:

                How to insert javascript code before my C# code

                You don't. JavaScript is run on the client, C# code is run on the server. I think you should reread a couple chapters in the book or ask the professor or TA for help, your missing some concepts.


                only two letters away from being an asset

                K Offline
                K Offline
                Kontakentee
                wrote on last edited by
                #7

                Honstly, I don't know anything about javascript, only heard about it. But you don't have any suggestions for me? Actually I don't know where to insert the code you have given me? Do you know a professor or TA that I can ask? Also, Do you have a good book that I can work with it easily? Thanks very much for help and sorry for any inconvenience I'm causing.

                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