How can I display a MessageBox in ASP.NET?

S

Steve Kershaw

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
 
B

bruce barker \(sqlwork.com\)

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)
 
J

John Timney \( MVP \)

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
 
S

Steve Kershaw

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.
 
M

Mike Lowery

Steve Kershaw said:
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.
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,007
Latest member
obedient dusk

Latest Threads

Top