Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Messagebox
Message
Information générale
Forum:
ASP.NET
Catégorie:
Autre
Titre:
Divers
Thread ID:
01502643
Message ID:
01502660
Vues:
33
>Hi
>
>I want to display a message when there are not results from a stored procedure
>
>I thought I could use
>
>MessageBox.Show
>

You can't use a message box in an ASP.NET application. Remember, that code would be running on the server so it would end up displaying the messagebox on the server (assuming it hadn't thrown an exception). The normal way to do this is to have something like a label or a div that is normally hidden on the page. In your save, if it fails, you do something like this:
bool success = someObj.Save();

if (success)
{  
   this.lblErrorMsg.Visible = false;
else
   this.lblErrorMsg.Text = "Sorry, no results were found.";
   this.lblErrorMsg.Visible = true;
}
-Paul

RCS Solutions, Inc.
Blog
Twitter
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform