Creating a user prompt

Discussion in 'ASP .Net' started by ree32, Oct 15, 2004.

  1. ree32

    ree32 Guest

    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, Oct 15, 2004
    #1
    1. Advertisements

  2. ree32

    Cirrosi Guest


    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, Oct 15, 2004
    #2
    1. Advertisements

  3. ree32

    Guest Guest

    Guest, Oct 15, 2004
    #3
  4. ree32

    ree32 Guest

    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
     
    ree32, Oct 18, 2004
    #4
    1. Advertisements

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 (here). After that, you can post your question and our members will help you out.