Does ASP.NET have the equivalent of VB's InputBox function?
Question
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?
Solution
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
OTHER TIPS
For more functionality, check out the asp.net ajax control toolkit, and specifically the modal popup box control.
Yes - use the prompt()
javascript function.
var x = prompt("enter a value");
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow