Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Simpler Way to Input Text

0 views
Skip to first unread message

Jonathan Wood

unread,
May 1, 2008, 7:20:01 PM5/1/08
to
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!

--
Jonathan Wood
SoftCircuits Programming
http://www.softcircuits.com

Fernando Rodriguez

unread,
May 1, 2008, 7:53:21 PM5/1/08
to
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

"Jonathan Wood" <jw...@softcircuits.com> wrote in message
news:e9UijH%23qIH...@TK2MSFTNGP05.phx.gbl...

0 new messages