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. Message Box Facility in ASP.NET

Message Box Facility in ASP.NET

Scheduled Pinned Locked Moved ASP.NET
csharpjavascriptasp-nethelp
5 Posts 3 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.
  • J Offline
    J Offline
    Jmshastri
    wrote on last edited by
    #1

    hi all, i want to have functionality of message box like VB.NET, but i don't know the syntax for that in asp.net. what and how should i write that in code behind section. i just know that the statement will be in javascript. but i don't know where and how to write it. suppose, if i want to display messagebox in action event of any button, what code should i write in its event handler. And how can i perform action event on that message box. That is, if i want to have yes/know kind of message box, what will be the values of the buttons on that message box please help me it's urgent.

    R 1 Reply Last reply
    0
    • J Jmshastri

      hi all, i want to have functionality of message box like VB.NET, but i don't know the syntax for that in asp.net. what and how should i write that in code behind section. i just know that the statement will be in javascript. but i don't know where and how to write it. suppose, if i want to display messagebox in action event of any button, what code should i write in its event handler. And how can i perform action event on that message box. That is, if i want to have yes/know kind of message box, what will be the values of the buttons on that message box please help me it's urgent.

      R Offline
      R Offline
      RichardGrimmer
      wrote on last edited by
      #2

      The javascript alert(message) function causes a message box to pop up on the client side. For a yes / no, use the confirm function.. The problem that you'll run into is that a) can't call javascript from a codebehind, and b)if you use Messagebox.show, it will only appear on the server! What I usually do is hook the event handler up on the client side in javascript, do my processing there and if I desperately need to go to the server, use AJAX.... Happy to help further if you're stuck.. "Now I guess I'll sit back and watch people misinterpret what I just said......" Christian Graus At The Soapbox

      J 1 Reply Last reply
      0
      • R RichardGrimmer

        The javascript alert(message) function causes a message box to pop up on the client side. For a yes / no, use the confirm function.. The problem that you'll run into is that a) can't call javascript from a codebehind, and b)if you use Messagebox.show, it will only appear on the server! What I usually do is hook the event handler up on the client side in javascript, do my processing there and if I desperately need to go to the server, use AJAX.... Happy to help further if you're stuck.. "Now I guess I'll sit back and watch people misinterpret what I just said......" Christian Graus At The Soapbox

        J Offline
        J Offline
        Jmshastri
        wrote on last edited by
        #3

        Hey, thanks for suggestion. but it would be beneficial to me if you write a small sample code snipet, because, if i want a handler for a button, and if the language is javascript, i dont know where and how to write that. please help.

        R 1 Reply Last reply
        0
        • J Jmshastri

          Hey, thanks for suggestion. but it would be beneficial to me if you write a small sample code snipet, because, if i want a handler for a button, and if the language is javascript, i dont know where and how to write that. please help.

          R Offline
          R Offline
          RichardGrimmer
          wrote on last edited by
          #4

          will tie the click event to the js function - just define as any js... (note there should be a colon between "javascript" and "functionToCall", but keeps ripping it out when I post!) email me if still struggling "Now I guess I'll sit back and watch people misinterpret what I just said......" Christian Graus At The Soapbox

          V 1 Reply Last reply
          0
          • R RichardGrimmer

            will tie the click event to the js function - just define as any js... (note there should be a colon between "javascript" and "functionToCall", but keeps ripping it out when I post!) email me if still struggling "Now I guess I'll sit back and watch people misinterpret what I just said......" Christian Graus At The Soapbox

            V Offline
            V Offline
            VK Link
            wrote on last edited by
            #5

            Hi - I tried the above but it comes back with : Compiler Error Message: BC30456: 'javascript' is not a member of 'ASP.myFile_aspx'. Thanks.

            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