J
JenHu
Hi experts,
In my asp.net application, I use VB.NET code. I want to have a
yes/no button in my popup message box when user click "Submit"
button. It will check if the employee is a rehire, if yes, delete
record from tableA, if no, add record to table B. I understand it
might require to have a javascript for this popup box, but :cry: I
am not familiar with javascript, so I tried couple of alternatives
and it doesn't work. I tried confirm(), but it only has OK/Cancel
buttons. I tried RegisterClientScriptBlock, but it doesn't has a
Yes/NO button to trap the condition.
Can someone show me how to put the javascript in vb.net code? Please
help!
now I am trying RegisterStartupScript, and here is the code not
working:
conGPDb.Open()
Dim strStmt As String = "SELECT COUNT(distinct EmployID) FROM
DD00200 where employID=" + txtEmpID.Text + " and
DDTRANUM='555555555'"
Dim cmd2 As SqlCommand = New SqlCommand(strStmt, conGPDb)
Dim RehireInd As Boolean = True
If cmd2.ExecuteScalar() > 0 Then
Dim popupScript As String = "<script
language='javascript'>" & _
"window.open('PopUp.aspx', 'CustomPopUp', " & _
"'width=200, height=200, menubar=yes, resizable=no')"
& _
"</script>"
ValidRecord = False
Page.RegisterStartupScript("Script",
"<script>VerifyForm()</script>")
End If
conGPDb.Close()
-------------------------------------------------------
*-----------------------*
Posted at:
www.GroupSrv.com
*-----------------------*
In my asp.net application, I use VB.NET code. I want to have a
yes/no button in my popup message box when user click "Submit"
button. It will check if the employee is a rehire, if yes, delete
record from tableA, if no, add record to table B. I understand it
might require to have a javascript for this popup box, but :cry: I
am not familiar with javascript, so I tried couple of alternatives
and it doesn't work. I tried confirm(), but it only has OK/Cancel
buttons. I tried RegisterClientScriptBlock, but it doesn't has a
Yes/NO button to trap the condition.
Can someone show me how to put the javascript in vb.net code? Please
help!
now I am trying RegisterStartupScript, and here is the code not
working:
conGPDb.Open()
Dim strStmt As String = "SELECT COUNT(distinct EmployID) FROM
DD00200 where employID=" + txtEmpID.Text + " and
DDTRANUM='555555555'"
Dim cmd2 As SqlCommand = New SqlCommand(strStmt, conGPDb)
Dim RehireInd As Boolean = True
If cmd2.ExecuteScalar() > 0 Then
Dim popupScript As String = "<script
language='javascript'>" & _
"window.open('PopUp.aspx', 'CustomPopUp', " & _
"'width=200, height=200, menubar=yes, resizable=no')"
& _
"</script>"
ValidRecord = False
Page.RegisterStartupScript("Script",
"<script>VerifyForm()</script>")
End If
conGPDb.Close()
-------------------------------------------------------
*-----------------------*
Posted at:
www.GroupSrv.com
*-----------------------*