Solved

Alert message

Posted on 2013-06-27
5
240 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

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

I recently went through the process of creating a Calendar Control of events with the basis of using a database to keep track of the dates that are selectable, one requirement was to have the selected date pop-up in a simple lightbox.  At first this…
The article shows the basic steps of integrating an HTML theme template into an ASP.NET MVC project
Come and listen to Percona CEO Peter Zaitsev discuss what’s new in Percona open source software, including Percona Server for MySQL (https://www.percona.com/software/mysql-database/percona-server) and MongoDB (https://www.percona.com/software/mongo-…
There are cases when e.g. an IT administrator wants to have full access and view into selected mailboxes on Exchange server, directly from his own email account in Outlook or Outlook Web Access. This proves useful when for example administrator want…

728 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