Warning Messages...

Discussion in 'ASP .Net Building Controls' started by Irfan Akram, Dec 27, 2004.

  1. Irfan Akram

    Irfan Akram Guest

    Hi Guys,

    I was wondering if you can help me with this question. I am trying to
    display warning messages on my web-page, prompting the user to check his
    action, and confirm what the current action would do. What is the best way of
    doing that in asp.net. I know that we can do that easily in windows
    programming, but I am not too sure in Web Programming. Will wait for a
    response, and will value your responses.

    Thanks,

    Irfan
     
    Irfan Akram, Dec 27, 2004
    #1
    1. Advertising

  2. "Irfan Akram" <> wrote in message
    news:...
    > Hi Guys,
    >
    > I was wondering if you can help me with this question. I am trying to
    > display warning messages on my web-page, prompting the user to check his
    > action, and confirm what the current action would do. What is the best way
    > of
    > doing that in asp.net. I know that we can do that easily in windows
    > programming, but I am not too sure in Web Programming. Will wait for a
    > response, and will value your responses.


    You can use the confirm function in client-side JavaScript, as follows:

    string confirm =
    string.Format(
    @"return confirm('Are you sure you want to delete {0}?');",
    name);
    lnkDelete.Attributes["onclick"] = confirm;

    When the button is clicked, a dialog box will be displayed. If the user
    clicks Ok, then the onclick event will continue (and in this case will do
    the normal postback). If the user clicks Cancel, then the onclick event will
    be cancelled, and it will be as though the button had not been clicked. This
    is because the confirm function returns true if Ok is clicked, false it
    Cancel is clicked.

    John Saunders
     
    John Saunders, Dec 28, 2004
    #2
    1. Advertising

  3. also, if you require more functionality than Confirm, you can popup a window
    that warns the user, which contains controls to handle their action.

    Mike



    "John Saunders" <johnwsaundersiii at hotmail.com> wrote in message
    news:%23t%...
    > "Irfan Akram" <> wrote in message
    > news:...
    > > Hi Guys,
    > >
    > > I was wondering if you can help me with this question. I am trying to
    > > display warning messages on my web-page, prompting the user to check his
    > > action, and confirm what the current action would do. What is the best

    way
    > > of
    > > doing that in asp.net. I know that we can do that easily in windows
    > > programming, but I am not too sure in Web Programming. Will wait for a
    > > response, and will value your responses.

    >
    > You can use the confirm function in client-side JavaScript, as follows:
    >
    > string confirm =
    > string.Format(
    > @"return confirm('Are you sure you want to delete {0}?');",
    > name);
    > lnkDelete.Attributes["onclick"] = confirm;
    >
    > When the button is clicked, a dialog box will be displayed. If the user
    > clicks Ok, then the onclick event will continue (and in this case will do
    > the normal postback). If the user clicks Cancel, then the onclick event

    will
    > be cancelled, and it will be as though the button had not been clicked.

    This
    > is because the confirm function returns true if Ok is clicked, false it
    > Cancel is clicked.
    >
    > John Saunders
    >
    >
    >
     
    Mike MacMillan, Jan 5, 2005
    #3
  4. Irfan Akram

    Jose Rojas Guest

    How can this get done by using direct ASP.NET not JS?

    Sorry I know this is not my question....
    Jose Rojas
    "Mike MacMillan" <> wrote in message
    news:j0OCd.8361$...
    > also, if you require more functionality than Confirm, you can popup a
    > window
    > that warns the user, which contains controls to handle their action.
    >
    > Mike
    >
    >
    >
    > "John Saunders" <johnwsaundersiii at hotmail.com> wrote in message
    > news:%23t%...
    >> "Irfan Akram" <> wrote in message
    >> news:...
    >> > Hi Guys,
    >> >
    >> > I was wondering if you can help me with this question. I am trying to
    >> > display warning messages on my web-page, prompting the user to check
    >> > his
    >> > action, and confirm what the current action would do. What is the best

    > way
    >> > of
    >> > doing that in asp.net. I know that we can do that easily in windows
    >> > programming, but I am not too sure in Web Programming. Will wait for a
    >> > response, and will value your responses.

    >>
    >> You can use the confirm function in client-side JavaScript, as follows:
    >>
    >> string confirm =
    >> string.Format(
    >> @"return confirm('Are you sure you want to delete {0}?');",
    >> name);
    >> lnkDelete.Attributes["onclick"] = confirm;
    >>
    >> When the button is clicked, a dialog box will be displayed. If the user
    >> clicks Ok, then the onclick event will continue (and in this case will do
    >> the normal postback). If the user clicks Cancel, then the onclick event

    > will
    >> be cancelled, and it will be as though the button had not been clicked.

    > This
    >> is because the confirm function returns true if Ok is clicked, false it
    >> Cancel is clicked.
    >>
    >> John Saunders
    >>
    >>
    >>

    >
    >
     
    Jose Rojas, Feb 19, 2005
    #4
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. =?Utf-8?B?SXJmYW4gQWtyYW0=?=

    Displaying warning messages...

    =?Utf-8?B?SXJmYW4gQWtyYW0=?=, Dec 27, 2004, in forum: ASP .Net
    Replies:
    2
    Views:
    724
    =?Utf-8?B?SXJmYW4gQWtyYW0=?=
    Dec 27, 2004
  2. Priyanka AGARWAL
    Replies:
    2
    Views:
    529
    Andrew Thompson
    Jan 31, 2005
  3. Priyanka AGARWAL
    Replies:
    1
    Views:
    323
    Andrew Thompson
    Feb 2, 2005
  4. Priyanka AGARWAL
    Replies:
    0
    Views:
    310
    Priyanka AGARWAL
    Feb 1, 2005
  5. RC
    Replies:
    4
    Views:
    9,179
    Tjerk Wolterink
    Jun 30, 2005
Loading...

Share This Page