?
Solved

Javascript Alert in VB.net

Posted on 2007-10-04
2
Medium Priority
?
2,376 Views
Last Modified: 2012-05-05
I have code

Private Sub btnSave_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnSave.Click
        If CkRequestor.Checked Then
            If CkAccountNumber.Checked = False Then
                Dim tempstring As String
                tempstring = "<Script language='Javascript'>"
                tempstring = tempstring & "Alert ('AccountNumber need be checked');"
                tempstring = tempstring & "</script>"
                Response.Write(tempstring)
                Exit Sub
            End If
        End If


But when I click on save button, there is an error said "Object Expected". How to fix?

Thanks,
0
Comment
Question by:dshi15
2 Comments
 
LVL 75

Accepted Solution

by:
Michel Plungjan earned 1000 total points
ID: 20013891
tempstring = "<Script language='Javascript'>"
tempstring = tempstring & "alert('AccountNumber needs to be checked');"
tempstring = tempstring & "</script>"

JS is case sensitive
0
 
LVL 1

Author Comment

by:dshi15
ID: 20013952
Thank you very much.
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

A long time ago (May 2011), I have written an article showing you how to create a DLL using Visual Studio 2005 to be hosted in SQL Server 2005. That was valid at that time and it is still valid if you are still using these versions. You can still re…
In this blog, we’ll look at how improvements to Percona XtraDB Cluster improved IST performance.
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…
Suggested Courses
Course of the Month14 days, 13 hours left to enroll

839 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