Solved

Creating a Message Popup in Visual Web Developer 2005

Posted on 2009-04-01
4
363 Views
Last Modified: 2012-05-06
I have an IF/Then statement  on an aspx.vb page. I need to popup an informational message when certain conditions are met. In searching the web it seem that javascript is what is needed but I can't find a basic example addressing my specific issue.
In other words would someone hold my hand and show me how to do this?

If Count(0) < 2 Then
Popup a message that says "There isn't enough data to create the chart"
0
Comment
Question by:quick503
  • 2
  • 2
4 Comments
 
LVL 5

Expert Comment

by:Buginator
ID: 24041113
Hello quick503,

I created a code snippet for you, it should work.
Please try it out and let me know.

Regards
If Count(0) < 2 Then
   Dim message As String = "There isn't enough data to create the chart."
   ClientScript.RegisterStartupScript(Me.[GetType](), "alert", [String].Concat("<script>alert('", message, "');</script>"))
End If

Open in new window

0
 

Author Comment

by:quick503
ID: 24041243
No Luck. The If/Then statement works but no message pops up.
0
 
LVL 5

Accepted Solution

by:
Buginator earned 500 total points
ID: 24041437
Sorry, sometimes javascript doesn't like single quotes '.
Here are the fixed version with double quotes:
If Count(0) < 2 Then
   Dim message As String = "There isn't enough data to create the chart."
   ClientScript.RegisterStartupScript(Me.[GetType](), "alert", [String].Concat("<script type='text/javascript'>alert(""", message, """);</script>"))
End If

Open in new window

0
 

Author Comment

by:quick503
ID: 24041566
That works great. Thanks
0

Featured Post

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Server Error 11 58
ASP.net Have sliders change in order 2 23
ASP.NET MVC 2 31
How to close an asp.net web form using C# ? 4 31
A quick way to get a menu to work on our website, is using the Menu control and assign it to a web.sitemap using SiteMapDataSource. Example of web.sitemap file: (CODE) Sample code to add to the page menu: (CODE) Running the application, we wi…
The article shows the basic steps of integrating an HTML theme template into an ASP.NET MVC project
This video shows how to quickly and easily add an email signature for all users on Exchange 2016. The resulting signature is applied on a server level by Exchange Online. The email signature template has been downloaded from: www.mail-signatures…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

803 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