views:

893

answers:

3

VB has a function InputBox() that will prompt the user to enter a single value, then click OK.

Is there a parallel functionality in ASP.NET, that will get the browser to pop up some kind of input box to return a single value?

If not, how do you recommend I achieve this effect?

+1  A: 

Yes - use the prompt() javascript function.

var x = prompt("enter a value");
Andrew Hare
You might want to provide an example of how he would access that value from the code-behind.
TheTXI
+3  A: 

For more functionality, check out the asp.net ajax control toolkit, and specifically the modal popup box control.

http://www.asp.net/ajax/

BenB
+4  A: 

You can do this in JavaScript

var result = prompt("Question", "Default text");
document.getElementById("HiddenInputBox").value = result;
document.HiddenForm.submit();

But most web apps seem to use of screen forms and simulated modal dialogs (fade and disable rest of screen)

jQuery is your friend for this, try simplemodal

TFD