当前位置: 动力学知识库 > 问答 > 编程问答 >

asp.net - Ajax replacment for JavaScript prompt command

问题描述:

The JavaScript prompt command

prompt("sometext","defaultvalue");

is a useful way to easily prompt the user to provide a value. But it can't really be a part of any polished web 2.0 application (The dialog looks horrible).

Is there any existing component to display a modal dialog that will prompt a user for a value? I can use a pure JavaScript solution or anything developed for ASP.NET

网友答案:

I'm sure there are a lot of things that fit the bill in of the most javascript frameworks out there. For instance, there are a few out there for jQuery e.g. Impromptu or if you want something specifically for ASP.NET then there are few things you could probably use from the ASP.NET Ajax Control Toolkit such as the Modal Dialog or of course, you could roll your own!

网友答案:

You can code your own solution with a div containing an input field and a button and some javascript to show/hide the div.

This will not block the javascript code flow so you will have to set a callback function on the Close/Ok button.

If you are ok with JS libraries almost all of them have a Dialog widget.

分享给朋友:
您可能感兴趣的文章:
随机阅读: