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. asp.net

asp.net

Scheduled Pinned Locked Moved ASP.NET
csharpasp-nettutorial
4 Posts 4 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.
  • S Offline
    S Offline
    sindhujadoss
    wrote on last edited by
    #1

    how to display message in Message box in asp.net with c#

    P J J 3 Replies Last reply
    0
    • S sindhujadoss

      how to display message in Message box in asp.net with c#

      P Offline
      P Offline
      pmarfleet
      wrote on last edited by
      #2

      Use the javascript alert method.

      Paul Marfleet "No, his mind is not for rent To any God or government" Tom Sawyer - Rush

      1 Reply Last reply
      0
      • S sindhujadoss

        how to display message in Message box in asp.net with c#

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

        Here is a simple procedure that dynamically builds a Javascript Alert Message and writes it to the client using Response.Write. you can use this procedure by adding it to the code-Behind. This would be useful when you do a server-side validation and want to prompt a alert message to the user.

        protected void MessageBox(string strMsg)
        {
        string strScript = "<script language=JavaScript>";
        strScript += "alert('" + strMsg + "');";
        strScript += "</script>";
        Response.Write(strScript);
        }

        - Regards -
           J O N


        A good thing is a bad thing if it keeps you from the best thing. - Dr. Adrian Rogers


        1 Reply Last reply
        0
        • S sindhujadoss

          how to display message in Message box in asp.net with c#

          J Offline
          J Offline
          Jintal Patel
          wrote on last edited by
          #4

          Page.ClientScript.RegisterStartupScript(Page.GetType(), "@msg", "alert('Message that u want to display...');", true);

          Jintal Patel

          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