How can I display a MessageBox in ASP.NET?

Discussion in 'ASP .Net' started by Steve Kershaw, May 26, 2006.

  1. Hi,

    I need to display a messagebox in ASP.NET that includes a textbox for
    input. There must be an easy way to do this!

    Thanks
    Steve
     
    Steve Kershaw, May 26, 2006
    #1
    1. Advertising

  2. this is known as a popup in the html world. current browser security
    requires this to be done from client script in response to click event.

    <a href="javascript:window.open('mypopup.aspx');">click here</a>

    to move data from the popup to the main window also requires javascript. you
    should buy a book on javascript programing if this is the direction you want
    to go.

    -- bruce (sqlwork.com)



    "Steve Kershaw" <> wrote in message
    news:...
    > Hi,
    >
    > I need to display a messagebox in ASP.NET that includes a textbox for
    > input. There must be an easy way to do this!
    >
    > Thanks
    > Steve
    >
     
    bruce barker \(sqlwork.com\), May 26, 2006
    #2
    1. Advertising

  3. Standard message box in a webbrowser is a javascript alert, standard
    inputbox is a javascript prompt. So you need a javascript function to do it
    which you can output.

    <SCRIPT language="JavaScript">
    <!--hide
    var yourname= prompt('Please enter your name, so you can get a special
    greeting', ' ');

    if ( (yourname==' ') || (yourname==null) )
    {
    yourname="Dude";
    }

    //-->
    </SCRIPT>
    Take a look here to see how to implement javascript functions in asp.net
    http://steveorr.net/articles/ClientSideSuite.aspx

    --
    Regards

    John Timney
    Microsoft MVP

    "Steve Kershaw" <> wrote in message
    news:...
    > Hi,
    >
    > I need to display a messagebox in ASP.NET that includes a textbox for
    > input. There must be an easy way to do this!
    >
    > Thanks
    > Steve
    >
     
    John Timney \( MVP \), May 26, 2006
    #3
  4. Thanks for your quick response.

    JavaScript has the problem that it is completely client side and I need
    to call a server side method with the user input. I need something like
    btnMyButton.Attributes.Add("onclick", "return confirm('Do you really
    want to do this?')"); Except the confirm popup dosen't have a textbox
    for user input.
     
    Steve Kershaw, May 26, 2006
    #4
  5. Steve Kershaw

    Mike Lowery Guest

    "Steve Kershaw" <> wrote in message
    news:...
    > Hi,
    >
    > I need to display a messagebox in ASP.NET that includes a textbox for
    > input. There must be an easy way to do this!


    Create a new web form that simulates the popup box and display it from your
    code. You can use HTML or Javascript to ensure it opens in a new window.
     
    Mike Lowery, May 26, 2006
    #5
  6. The JavaScript "Confirm" method should do the trick.

    Here are the details, along with some free components that will do it for
    you:
    http://SteveOrr.net/articles/ClientSideSuite.aspx

    --
    I hope this helps,
    Steve C. Orr, MCSD, MVP
    http://SteveOrr.net


    "Steve Kershaw" <> wrote in message
    news:...
    > Hi,
    >
    > I need to display a messagebox in ASP.NET that includes a textbox for
    > input. There must be an easy way to do this!
    >
    > Thanks
    > Steve
    >
     
    Steve C. Orr [MVP, MCSD], May 26, 2006
    #6
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Matthew Louden

    messagebox in ASP.NET using VB.NET

    Matthew Louden, Oct 22, 2003, in forum: ASP .Net
    Replies:
    1
    Views:
    10,188
    Kevin Spencer
    Oct 22, 2003
  2. Paul Wilson

    how to display a MessageBox in ASP.net

    Paul Wilson, Jun 21, 2004, in forum: ASP .Net
    Replies:
    3
    Views:
    4,198
    =?Utf-8?B?QW5vdGhlciBvcHRpb24=?=
    Jun 21, 2004
  3. soundar rajan
    Replies:
    2
    Views:
    3,673
    =?Utf-8?B?RG90TmV0SmVyb21l?=
    Feb 24, 2005
  4. Replies:
    3
    Views:
    6,757
  5. Matthew Louden

    messagebox in ASP.NET using VB.NET

    Matthew Louden, Oct 22, 2003, in forum: ASP .Net Web Controls
    Replies:
    1
    Views:
    1,572
    Kevin Spencer
    Oct 22, 2003
Loading...

Share This Page