Simpler Way to Input Text

J

Jonathan Wood

Greetings,

I have a site where the users manages a number of items. I've added commands
to create a new item, rename an existing item, copy an existing item, and
delete an existing item.

For each command, I need the user to either enter an item name or confirm
deletion. I'm looking at creating four additional pages that simply have a
prompt and an edit control (or a confirmation button).

Isn't there an easier way? I know that ASP.NET allows in-place editing of
GridView items. Is there a simple way to take that approach rather than
creating four additional pages?

Thanks for any tips!
 
F

Fernando Rodriguez

One way is to use the JavaScript prompt function. See this link for more
details: http://www.htmlgoodies.com/primers/jsp/article.php/3478471

To use it on an ASP.NET application you will need to write a JavaScript
function that calls the prompt function and stores the user input into an
HtmlHiddenField (a standard <input type="hidden"> tag with a runat="server"
attribute), so that you can access the value on the server. Then on your set
the onclick attribute of you command control to call this function. You can
also make the function return false if the user doesn't enter any imput or
enters invalid input so that the postback gets cancelled.

That's IMO the easiest way, it's not the nicest or more professional one. I
would prefer using a floating DHTML popup.

Hope that helps,
Fernando L Rodriguez, MCP
 

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,537
Members
45,021
Latest member
AkilahJaim

Latest Threads

Top