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
Solved

Creating a Message Popup in Visual Web Developer 2005

Posted on 2009-04-01
4
364 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

Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

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

Just a quick little trick I learned recently.  Now that I'm using jQuery with abandon in my asp.net applications, I have grown tired of the following syntax:      (CODE) I suppose it just offends my sense of decency to put inline VBScript on a…
Sometimes in DotNetNuke module development you want to swap controls within the same module definition.  In doing this DNN (somewhat annoyingly) swaps the Skin and Container definitions to the default admin selections.  To get around this you need t…
I've attached the XLSM Excel spreadsheet I used in the video and also text files containing the macros used below. https://filedb.experts-exchange.com/incoming/2017/03_w12/1151775/Permutations.txt https://filedb.experts-exchange.com/incoming/201…

856 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