本文介绍了[不是问题] diplay成功的消息的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要在保存后显示成功的消息,当无法保存不成功的消息时,应显示在vb

请快速帮助我,我在vb

I need to display successful message after i saved and when not able to save an unsuccessful message should display in vb
please help me fast i am nw in vb

推荐答案

MessageBox.Show("It Worked!")





如果您正在使用网站,请尝试:



If you are working with a web site however, try:

Response.Write("<br />It Worked!<br />")

因为第一种方法似乎只能在开发中使用,并且在生产中会失败。

As the first method will only appear to work in development and will fail in production.


Private Sub SomeMethodorEvent() 
Try  
 If IsDataSaved() Then   'Funtion which saves data   
  lblError.Text = "Data has been saved successfully"  
 Else   
  lblError.Text = "Data not saved"  
 End If 
Catch ex As Exception  
 LogError(ex)  'Some funtion to save actual error details
 lblError.Text = "Data not saved" 
End Try
End Sub
Private Function IsDataSaved() As Boolean 
 'Data saving code
End Function





编辑

-------------

查看本教程

[]


这篇关于[不是问题] diplay成功的消息的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-29 01:45