467,146 Members | 1,293 Online
Bytes | Developer Community
Ask Question

Home New Posts Topics Members FAQ

Post your question to a community of 467,146 developers. It's quick & easy.

Displaying warning messages...

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
Nov 19 '05 #1
  • viewed: 2643
Share:
2 Replies
Here's some server side code that uses javascript to display a confirmation
message.
myDeleteButton.Attributes.Add("onclick", _
"return confirm('Are you sure you want to delete?');")

In this example, the Delete button will post back only if the person
confirms they want to delete. Otherwise your server code is never called in
response to the button click.

--
I hope this helps,
Steve C. Orr, MCSD, MVP
http://Steve.Orr.net
"Irfan Akram" <Ir********@discussions.microsoft.com> wrote in message
news:5A**********************************@microsof t.com...
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

Nov 19 '05 #2
Hi Mr.Steve,

First of all many thanks for your kind response. The thing is that I am
trying to control the user's action of deselecting a checkbox, once he has
selected it. Also the checkbox has been generated dynamically. If it is
selected I do some other processing, so if it is then deselected then the
whole page has to be resetted, hence the sense of displaying the warning
message. The problem is that I dont want the warning message to be displayed
when it is deselected, but only when it is deselected. Hope you understand
me....

Hope you have.....will wait for your kind reply...

Many thanks,

Irfan

"Steve C. Orr [MVP, MCSD]" wrote:
Here's some server side code that uses javascript to display a confirmation
message.
myDeleteButton.Attributes.Add("onclick", _
"return confirm('Are you sure you want to delete?');")

In this example, the Delete button will post back only if the person
confirms they want to delete. Otherwise your server code is never called in
response to the button click.

--
I hope this helps,
Steve C. Orr, MCSD, MVP
http://Steve.Orr.net
"Irfan Akram" <Ir********@discussions.microsoft.com> wrote in message
news:5A**********************************@microsof t.com...
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


Nov 19 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

2 posts views Thread by Jean Brouwers | last post: by
1 post views Thread by Raed Sawalha | last post: by
3 posts views Thread by Chuck Cobb | last post: by
4 posts views Thread by lucavilla@cashette.com | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.