vendredi 14 juillet 2017

If error handling ASP.net web forms

how to display a message and stop the remaining codes from running.

eg. `if (num == -1) { message.Text = "wrong";

            }
            int happy == 0;

            if (happy != 0)
            {
                message.Text = "wrong";
            }`

if num is =-1 it should show the message and not execute the remaining codes.

how do i do that?

p.s. this is just a example

Aucun commentaire:

Enregistrer un commentaire