Solved

Alert message

Posted on 2013-06-27
5
238 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 27

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

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

User art_snob (http://www.experts-exchange.com/M_6114203.html) encountered strange behavior of Android Web browser on his Mobile Web site. It took a while to find the true cause. It happens so, that the Android Web browser (at least up to OS ver. 2.…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
This Micro Tutorial will give you a basic overview how to record your screen with Microsoft Expression Encoder. This program is still free and open for the public to download. This will be demonstrated using Microsoft Expression Encoder 4.
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…

825 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