Solved

Alert message

Posted on 2013-06-27
5
239 Views
Last Modified: 2013-10-03
I need to have pop up message inside an if statement.

If false
    Pop Up (only "ok" button)
end if

Once user clicks ok the code should continue with what its suppose to do next.

this is for asp.net with VB.net code.
0
Comment
Question by:pratikshahse
5 Comments
 
LVL 40

Accepted Solution

by:
Kyle Abrahams earned 500 total points
ID: 39282808
if false
    string script = "alert ('This is a message');"
    ScriptManager.RegisterStartupScript(me.Page, typeof(Page), "Popup", script, true)
'if typeof page doesn't work do me.Page.GetType()
end if
0
 
LVL 83

Expert Comment

by:CodeCruiser
ID: 39282825
You can show a popup on client side but your second requirement to continue code execution after the popup can not be met in ASP.NET. In ASP.NET, code has to complete execution, response has to be sent to the client and then popup can be shown on client side.
0
 
LVL 40

Expert Comment

by:Kyle Abrahams
ID: 39282894
The register startup script will flag that the popup needs to show, but CC is correct, there's no way to go back and forth between server and client.
0
 
LVL 10

Expert Comment

by:Monica P
ID: 39283704
can u make a try like this


if (false)
Response.Write("<script>alert('Condition is False...');</script>")
end if

Open in new window

0
 
LVL 28

Expert Comment

by:Ark
ID: 39288798
It's VB#? Use "Then" or remove "end if". You can use 'fake' page with alert only and Response/Server.Redirect conditionally.
if (false) Response.Redirect("dummy.html");
'dummy.html
<script>alert('whatever');document.location.href='realPage.asp?fromDummy=1';</script>
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

IntroductionWhile developing web applications, a single page might contain many regions and each region might contain many number of controls with the capability to perform  postback. Many times you might need to perform some action on an ASP.NET po…
The ECB site provides FX rates for major currencies since its inception in 1999 in the form of an XML feed. The files have the following format (reducted for brevity) (CODE) There are three files available HERE (http://www.ecb.europa.eu/stats/exch…
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…
Attackers love to prey on accounts that have privileges. Reducing privileged accounts and protecting privileged accounts therefore is paramount. Users, groups, and service accounts need to be protected to help protect the entire Active Directory …

730 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question