Creating a user prompt

  • Thread starter Thread starter ree32
  • Start date Start date
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.
 
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.
 
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
 
Back
Top