[不是问题] diplay成功的消息 [英] [Not a question] diplay successfull message

查看:97
本文介绍了[不是问题] 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

推荐答案

尝试:

Try:
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.


您应该根据这种情况编写代码,这里是一个示例。 自定义

You should write code according to that situation, here a sample. Customize it.
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





编辑

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

查看本教程

C#MessageBox.Show [ ^ ]


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

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆