How to popup a messagebox with asp.net?
Rick,
You really can't (nor do you want to). The code that is run in the
event handler is being executed on the server side. If you popped up a
message box, then you would stop the thread from processing and then you
would really have a mess.
What you want to do is have your event handler modify the result that is
returned to the client so that a call to window.alert is made on the client
side with your message.
Hope this helps.
--
- Nicholas Paldino [.NET MVP]
Quote:
> Hi there,
> I writing a web application with asp.net. The language I choose is C#. Now
I
> have an OnServerClick event handler for a datagrid delete button, and I
> wanna put a confirmation message before the deletion actually takes place.
> Would anybody tell me how to popup a messagebox right in the event handler
> with asp.net?
> Thanks in advance!
> Cheers,
> Rick