Foros del Web » Programación para mayores de 30 ;) » .NET »

MsgBOx

Estas en el tema de MsgBOx en el foro de .NET en Foros del Web. hola a todos: estoy desarrolando un sitio web en asp.net programando en VB dentro de una condiccion IF trato de mostrar un mensaje , o ...
  #1 (permalink)  
Antiguo 18/04/2003, 22:28
 
Fecha de Ingreso: marzo-2003
Ubicación: Ciudad Habana, Cuba
Mensajes: 57
Antigüedad: 21 años, 2 meses
Puntos: 0
MsgBOx

hola a todos:

estoy desarrolando un sitio web en asp.net programando en VB
dentro de una condiccion IF trato de mostrar un mensaje , o sea,
MsgBox("Mensaje",MsgBoxStyle.Exclamation) y cuando ejecuto la aplicacion me da el siguiente error...It is invalid to show a modal dialog or form when the application is not running in UserInteractive mode. Specify the ServiceNotification or DefaultDesktopOnly style to display a notification from a service application.
En Asp se podia invocar esa funcion VB sin ningun problema....
Que error tengo????
  #2 (permalink)  
Antiguo 16/05/2003, 16:31
Avatar de lexus  
Fecha de Ingreso: enero-2002
Ubicación: Cali - Colombia
Mensajes: 2.234
Antigüedad: 22 años, 4 meses
Puntos: 4
si deseas, consulta este explicacion de msgbox, depronto te sirve de algo.

http://www.programacion.com/asp/tuto...3/#cap8_msgbox
__________________
Control de Visitantes, Control de Accesos, Minutas digitales, Manejo de Correspondencia
http://www.controldevisitantes.com
  #3 (permalink)  
Antiguo 17/05/2003, 10:58
Avatar de Henry Zapata  
Fecha de Ingreso: abril-2001
Mensajes: 125
Antigüedad: 23 años, 1 mes
Puntos: 0
Hola:

Aqui un ejemplo de la ayuda de vs.net :

Private Sub ValidateUserEntry2()


' Checks the value of the text.

If ServerName.Text.Length = 0 Then

' Initializes variables to pass to the MessageBox.Show method.

Dim Message As String = "You did not enter a server name. Cancel this operation?"
Dim Caption As String = "No Server Name Specified"
Dim Buttons As Integer = MessageBoxButtons.YesNo

Dim Result As DialogResult

'Displays a MessageBox using the Question icon and specifying the No button as the default.

Result = MessageBox.Show(Me, Message, Caption, MessageBoxButtons.YesNo, _
MessageBoxIcon.Question, MessageBoxDefaultButton.Button1, MessageBoxOptions.RightAlign)


' Gets the result of the MessageBox display.

If Result = DialogResult.Yes Then

' Closes the parent form.

Me.Close()

End If

End If

End Sub
[C#]

private void validateUserEntry2()
{

// Checks the value of the text.

if(serverName.Text.Length == 0)
{

// Initializes the variables to pass to the MessageBox.Show method.

string message = "You did not enter a server name. Cancel this operation?";
string caption = "No Server Name Specified";
MessageBoxButtons buttons = MessageBoxButtons.YesNo;
DialogResult result;

// Displays the MessageBox.

result = MessageBox.Show(this, message, caption, buttons,
MessageBoxIcon.Question, MessageBoxDefaultButton.Button1,
MessageBoxOptions.RightAlign);

if(result == DialogResult.Yes)
{

// Closes the parent form.

this.Close();

}

}

}


saludos!!
Atención: Estás leyendo un tema que no tiene actividad desde hace más de 6 MESES, te recomendamos abrir un Nuevo tema en lugar de responder al actual.
Respuesta




La zona horaria es GMT -6. Ahora son las 12:20.