The code in an ASP page gets processed by the server before it gets sent to the client, so you can't really force a msgbox explicitly in ASP. You could either escape from ASP (%>) and put in client-side VBScript when you need a msgbox, or just have the ASP write out the client-side script.
in your HTML ouside the <% %> area..
Bear in mind that Netscape does not support VBScript and that the MsgBox will only be shown in an Internet Explorer client.. For multi-platform use Javascript instead, like this:
MsgBoxes are quite handy at times.. Figure this, you need to display a confirmation on delete for instances, then a dialog showing up, saying 'Are you sure? Yes/No' is the best way, otherwise you have to make a call to a html file containing the html alert, and only then do the delete.
The NET as we know it, could be alot faster for everyone if people used the fastest and most efficient way of achieving their goal.
I have to disagree. I find it is better to do as much as possible on the server. Confirmations can just as easily happen thru server-side code without msgboxes. Adding an additional page be it asp, jsp, php, or whatever is easy if your framework is developed properly. Most people see it as an inconvenience because they don't use proper Object-Oriented Design where developing in the first place and it becomes a problem.
Message Boxes are ugly and the distract from the overall appeal of the site. How do you apply a css to a msgbox? Not to mention client-side programming (not in this specific case if you use javascript) is the pain because of cross browser issues. I don't even like to do client-side validation. Wushutwist
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.