Simpler Way to Input Text

  • Thread starter Thread starter Jonathan Wood
  • Start date Start date
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!
 
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
 
Back
Top