Creating a user prompt

R

ree32

I am creating a page with the usual feature to access a DB and edit.

I have the common delete command in the datalist. But I need to create
a prompt to display and ask the user again if they really want to
delete this record.

But I am a bit puzzled as to how to go about this when you are dealing
with a datalist delete command. As I don't want to lose the details,
of the selected to be deleted item on page reload. Would I need to use
sessions?

Since the user prompt was pretty useful and may be needed for other
times. I was thinking of creating a generic one with 2 buttons (Yes &
No). But then I would need to assign different command functions to be
executed depending on what the prompt is asking. I know you can assign
numerous buttons to a function, but how about the other way. I.e. one
button with numerous functions and where a function will be executed
depending on what is being asked? Or is this impossible? Or is there a
nifty way to implement this than having all the functions in one big
function and using a select statement.
 
C

Cirrosi

ree32 said:
I am creating a page with the usual feature to access a DB and edit.

I have the common delete command in the datalist. But I need to create
a prompt to display and ask the user again if they really want to
delete this record.

But I am a bit puzzled as to how to go about this when you are dealing
with a datalist delete command. As I don't want to lose the details,
of the selected to be deleted item on page reload. Would I need to use
sessions?

Since the user prompt was pretty useful and may be needed for other
times. I was thinking of creating a generic one with 2 buttons (Yes &
No). But then I would need to assign different command functions to be
executed depending on what the prompt is asking. I know you can assign
numerous buttons to a function, but how about the other way. I.e. one
button with numerous functions and where a function will be executed
depending on what is being asked? Or is this impossible? Or is there a
nifty way to implement this than having all the functions in one big
function and using a select statement.


You can avoid to post page for message.

buttondeletename.attributes["onclick"]="return confirm('are you sure
.....?)";

I don't remember if the return is nedeed.
 
R

ree32

Cirrosi said:
You can avoid to post page for message.

buttondeletename.attributes["onclick"]="return confirm('are you sure
....?)";

I don't remember if the return is nedeed.

This is great but is there anyway to have this attribute work only if
certain values are entered in a textbox, so you can bypass the
confirmation if "safer" values are entered.

Also because these controls are in a datalist accessing them is a lot
harder as I can only modify them in the OnItemDataBound function.

Thanks
 

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,744
Messages
2,569,483
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top