Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Messagebox
Message
General information
Forum:
ASP.NET
Category:
Other
Title:
Miscellaneous
Thread ID:
01502643
Message ID:
01502660
Views:
32
>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
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform