Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Popup message

Status
Not open for further replies.

rnooraei

Programmer
Joined
Apr 5, 2005
Messages
74
Location
CA
Hi
How could I have a javascript pop message in the following code? I don't have any button to attach my code like this
Button1.Attributes.Add("onclick", "javascript:return confirm('My message')")

I would like to popup a message when I switch beetween to event. Any help appreicated.

Thanks

Protected Sub FormViewContacts_ItemInserting(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.FormViewInsertEventArgs) Handles FormViewContacts.ItemInserting
Dim dbConn As New OleDbConnection(ConfigurationManager.ConnectionStrings("BarConnectionString").ConnectionString)
dbConn.Open()


Dim dbSQL As String = "SELECT * FROM tblContacts"
Dim dbCmd As New OleDbCommand(dbSQL, dbConn)
Dim dbRead = dbCmd.ExecuteReader

While dbRead.Read()
Dim t As String
If IsDBNull(dbRead("ContactType")) Then
....... My message
e.Cancel = True
End If
End While
dbRead.Close()
dbConn.Close()
End Sub
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top