如何使用asp.net中的detailsview将数据成功插入数据库时​​显示确认msgbox?

时间:2010-12-06 04:47:03

标签: asp.net vb.net

使用asp.net中的详细信息视图将数据成功插入数据库时​​显示确认消息框?

1 个答案:

答案 0 :(得分:1)

ASP.NET没有可用的MsgBox。您可以使用JavaScript提醒。

Page.ClientScript.RegisterStartupScript(Me.GetType(), "MyScript", "alert('successfully!');", True)

for ItemCreated:

Protected Sub DetailsView1_ItemCreated(ByVal sender As Object, ByVal e As EventArgs)
  Page.ClientScript.RegisterStartupScript(Me.GetType(), "MyScript", "alert('successfully!');", True)
End Sub
<asp:detailsview id="DetailsView1"
...
onitemcreated="DetailsView1_ItemCreated"   
runat="server"></asp:detailsview>