 |
|
สอบถามเกี่ยวกับ JS Alert: Page.ClientScript.RegisterStartupScript() ใน VB.NET ค่ะ |
|
 |
|
|
 |
 |
|
Code (VB.NET)
Protected Sub btnCancel_Click(ByVal sender As Object, ByVal e As System.EventArgs) 'Handles btnCancel.ServerClick
Dim Cn As New OleDb.OleDbConnection(StrConn)
Dim CnSeat As New OleDb.OleDbConnection(StrConn)
'MsgBox("Confirm to delete your booking.", MsgBoxStyle.Exclamation + MsgBoxStyle.MsgBoxSetForeground + MsgBoxStyle.OkOnly, "Message from Air Bus Booking")
'Alert
'Response.Write("<script language='javascript'>window.alert('Confirm to delete your booking.');</script>")
Page.ClientScript.RegisterStartupScript(btnCancel.GetType, "Alert", "alert('Confirm to delete your booking.');", True)
DeleteData(Cn) 'Delete WEBAPPD.ABK010P
DeleteSeat(CnSeat) 'Delete WEBAPPD.ABK020P
Session("Ext") = Nothing
Session("Bkk") = Nothing
Session("DepartBkk") = Nothing
Session("Lbe") = Nothing
Session("DepartLbe") = Nothing
Session("Lbm") = Nothing
Session("DepartLbm") = Nothing
'MsgBox("Delete your booking complete.", MsgBoxStyle.MsgBoxSetForeground + MsgBoxStyle.OkOnly, "Message from Air Bus Booking")
'Alert
'Response.Write("<script language='javascript'>window.alert('Delete your booking complete.');</script>")
'Response.Write("<script language='javascript'>window.location.href('AirBusMenu.aspx');</script>")
Page.ClientScript.RegisterStartupScript(****.GetType, "", "alert('Delete your booking complete.');location.href='AirBusMenu.aspx';", True)
Exit Sub
End Sub
ต้องการให้ alert 2 ครั้งค่ะ เป็นพอคลิ๊กครั้งแรก ให้ alert ให้คลิ๊กเพื่อ confirm delete แล้วให้ alert อีกครั้งเพื่อบอกให้รู้ว่า Delete แล้ว
อยากรู้ว่า Page.ClientScript.RegisterStartupScript(****.GetType, "", "alert('Delete your booking ตรง **** ต้องใส่อะไรคะ ถ้าเป็น btnCancel เหมิอนอันแรก มันต้องคลิ๊กที่ปุ่มก่อนน่ะค่ะ ต้องการให้รับค่าจาก alert ครั้งแรกมาเลย แล้วก้โชว์ alert ครั้งที่สอง
ขอบคุณมากค่ะ
Tag : .NET, JavaScript, Web (ASP.NET), VB.NET
|
|
 |
 |
 |
 |
Date :
2012-08-16 10:20:02 |
By :
BKAJU1987 |
View :
2379 |
Reply :
2 |
|
 |
 |
 |
 |
|
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
ได้แล้วค่ะ...ลองผิดลองถูกดู
Code (VB.NET)
Page.ClientScript.RegisterStartupScript(Page.GetType, "", "alert('Delete your booking complete.');location.href='AirBusMenu.aspx';", True)
|
 |
 |
 |
 |
Date :
2012-08-16 10:28:40 |
By :
BKAJU1987 |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
แจ่มครับ 
|
 |
 |
 |
 |
Date :
2012-08-16 14:17:35 |
By :
mr.win |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
|
|