Inconveniente con la función MesageBox en C#
-
Cordial saludo equipo de Programacion.net les escribe Hernán Martínez saludos desde Colombia, agradezco si me pueden colaborar acerca del inconveniente que tengo respecto a la apertura de una página web que tengo desarrollada haciendo uso de los lenguajes de programación C# ASP.Net:
Antes tengo que aclarar que tengo varias paginas de similar desarrollo dentro de mi proyecto en donde hago uso de la función MessageBox.show
Pero al abrir esta pagina mediante un hiperenlace o hipervínculo me muestra el siguiente error:
Error de servidor en la aplicación '/'.
________________________________________
Error de compilación
Descripción: Error durante la compilación de un recurso requerido para dar servicio a esta solicitud. Revise los detalles de error específicos siguientes y modifique el código fuente en consecuencia.Mensaje de error del compilador: CS0103: The name 'MessageBox' does not exist in the current context
He visto foros en donde aclaran ese inconveniente y las soluciones que me plantean es:
• Que haga lo mismo, pero en Javascript
• Que utilice Alerts en vez de MessageBox
• Que incluya la referencia System.Windows.Forms y que incluya
using System.Windows.Forms;, cosa que he hecho pero que no he tenido éxito.
La idea como es obvia es que me sirva con la función ‘MessageBox’, como me sirve en las otras páginas de mi proyecto.
Muchas gracias por la colaboración que me puedan brindar -
Cordial saludo equipo de Programacion.net les escribe Hernán Martínez saludos desde Colombia, agradezco si me pueden colaborar acerca del inconveniente que tengo respecto a la apertura de una página web que tengo desarrollada haciendo uso de los lenguajes de programación C# ASP.Net:
Antes tengo que aclarar que tengo varias paginas de similar desarrollo dentro de mi proyecto en donde hago uso de la función MessageBox.show
Pero al abrir esta pagina mediante un hiperenlace o hipervínculo me muestra el siguiente error:
Error de servidor en la aplicación '/'.
________________________________________
Error de compilación
Descripción: Error durante la compilación de un recurso requerido para dar servicio a esta solicitud. Revise los detalles de error específicos siguientes y modifique el código fuente en consecuencia.Mensaje de error del compilador: CS0103: The name 'MessageBox' does not exist in the current context
He visto foros en donde aclaran ese inconveniente y las soluciones que me plantean es:
• Que haga lo mismo, pero en Javascript
• Que utilice Alerts en vez de MessageBox
• Que incluya la referencia System.Windows.Forms y que incluya
using System.Windows.Forms;, cosa que he hecho pero que no he tenido éxito.
La idea como es obvia es que me sirva con la función ‘MessageBox’, como me sirve en las otras páginas de mi proyecto.
Muchas gracias por la colaboración que me puedan brindar -
Here is the Google Translate for the message: Cordial greeting team of Programacion.net writes hernán Martínez greetings from Colombia, I appreciate if you can help me about the inconvenience I have regarding the opening of a website that I have developed using the programming languages of ASP.Net: First I have to clarify that I have several pages of similar development within my project where I make use of the MessageBox.show function But opening this page using a hyperlink or hyperlink shows me the following error: Server error in application '/'. ________________________________________ Build failed Description: An error occurred while compiling a resource required to service this request. Review the specific error details below and modify the source code accordingly. Compiler error message: CS0103: The name 'MessageBox' does not exist in the current context I have seen forums where they clarify this inconvenience and the solutions they pose to me is: • Do the same, but in Javascript • Use Alerts instead of MessageBox • Include the System.Windows.Forms reference and include using System.Windows.Forms;, which I have done but have not been successful. The idea as is obvious is that it serves me with the 'MessageBox' function, as it serves me on the other pages of my project. Thank you very much for the collaboration you can give me It looks like the requester is trying to display messages on a web page but is using MessageBox which is not a JavaScript method. He / she says it works on other pages of the project. He / she should look at the other pages in the project and see what they are doing that is different from what is being done on the page he / she is working on.
-
Here is the Google Translate for the message: Cordial greeting team of Programacion.net writes hernán Martínez greetings from Colombia, I appreciate if you can help me about the inconvenience I have regarding the opening of a website that I have developed using the programming languages of ASP.Net: First I have to clarify that I have several pages of similar development within my project where I make use of the MessageBox.show function But opening this page using a hyperlink or hyperlink shows me the following error: Server error in application '/'. ________________________________________ Build failed Description: An error occurred while compiling a resource required to service this request. Review the specific error details below and modify the source code accordingly. Compiler error message: CS0103: The name 'MessageBox' does not exist in the current context I have seen forums where they clarify this inconvenience and the solutions they pose to me is: • Do the same, but in Javascript • Use Alerts instead of MessageBox • Include the System.Windows.Forms reference and include using System.Windows.Forms;, which I have done but have not been successful. The idea as is obvious is that it serves me with the 'MessageBox' function, as it serves me on the other pages of my project. Thank you very much for the collaboration you can give me It looks like the requester is trying to display messages on a web page but is using MessageBox which is not a JavaScript method. He / she says it works on other pages of the project. He / she should look at the other pages in the project and see what they are doing that is different from what is being done on the page he / she is working on.
This is a common problem where people build on their own systems and it appears to work (client and server on the same platform). But as soon as they deploy it falls over. As that famous scene in Cool Hand Luke has it, "What we have here is a failure to communicate".
-
Cordial saludo equipo de Programacion.net les escribe Hernán Martínez saludos desde Colombia, agradezco si me pueden colaborar acerca del inconveniente que tengo respecto a la apertura de una página web que tengo desarrollada haciendo uso de los lenguajes de programación C# ASP.Net:
Antes tengo que aclarar que tengo varias paginas de similar desarrollo dentro de mi proyecto en donde hago uso de la función MessageBox.show
Pero al abrir esta pagina mediante un hiperenlace o hipervínculo me muestra el siguiente error:
Error de servidor en la aplicación '/'.
________________________________________
Error de compilación
Descripción: Error durante la compilación de un recurso requerido para dar servicio a esta solicitud. Revise los detalles de error específicos siguientes y modifique el código fuente en consecuencia.Mensaje de error del compilador: CS0103: The name 'MessageBox' does not exist in the current context
He visto foros en donde aclaran ese inconveniente y las soluciones que me plantean es:
• Que haga lo mismo, pero en Javascript
• Que utilice Alerts en vez de MessageBox
• Que incluya la referencia System.Windows.Forms y que incluya
using System.Windows.Forms;, cosa que he hecho pero que no he tenido éxito.
La idea como es obvia es que me sirva con la función ‘MessageBox’, como me sirve en las otras páginas de mi proyecto.
Muchas gracias por la colaboración que me puedan brindarWebsites ... so many problems unless you understand what is going on ... There are two major components to a website: the Front end and the Back end. The Front end is written in Javascript / HTML and executes on the Client computer within his browser. The Back end is written in C# (or VB, or PHP) and executes on the Server computer within the web server software. And that means that when you call MessageBox you are executing code on the Server, not the Client - and even if MessageBox is installed on eth Server, the message would display there, not on the Client browser. It appears to work in development because the Server and Client are both running on the same machine - the server MessageBox pops up and it looks fine because nothing indicates where it's from. In production, they aren't the same computer, and the MessageBox (if any) will pop up on the Server (which probably doesn't have a display, and even if it did nobody is looking at it) so the Client just appears to freeze and the page times out without responding. To pop up a message on the browser, you have to insert the Javascript code into your HTML page and send it to the client as normal: Window alert() Method[^]
"I have no idea what I did, but I'm taking full credit for it." - ThisOldTony "Common sense is so rare these days, it should be classified as a super power" - Random T-shirt AntiTwitter: @DalekDave is now a follower!