Click here to Skip to main content
15,889,116 members
Please Sign up or sign in to vote.
1.00/5 (3 votes)
See more:
private void button1_Click(object sender, EventArgs e)
{
    MessageBox.Show("dsfkl");
    if(qualDia == 0){
        checkF();
    }

}


What I have tried:

Doesn't working why?
Posted
Updated 6-Mar-20 4:05am
Comments
Richard MacCutchan 6-Mar-20 9:46am    
You need to provide more information. That call should show a MessageBox containing that text and an OK button.
Richard Deeming 6-Mar-20 9:52am    
If this is an ASP.NET application, then that's by design. The code is running on the server, so the message would appear on the server where nobody would ever see it, and your code would hang waiting for an administrator to log in to the server and acknowledge hundreds of messages.

If this isn't ASP.NET, then you need to provide a lot more information.

1 solution

If this is a web application, then yes, it is. Just you can't see it.

C# code runs at the server, not the client, so all direct user interaction shows up on the server - so your MessageBox opens on the Server several thousand miles from the client, on a machine that probably has no monitor, mouse, or keyboard attached; and as a result the user can't see it at all.

It seems to work in dev because the client and server are the same machine - so the C# code on the server showing a message box looks like it's fine.

You cannot open a MessageBox, or a command window, or fetch input directly from the user at all - the best you can do is use an Alert in your Javascript code, or display something as part of your HTML code.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900