Click here to Skip to main content
15,885,141 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
I tried using the MessageBox bit it doesn't work .

I'm Programming in VS 2010 C# ASP.NET


C#
if (lblStatus.Text == "YES")
                  {
                    MessageBox.Show("LOAN PROCESSING HAS BEEN RUN FOR THIS MONTH.","LOAN PROCESSING",MessageBoxButtons.OK);
                  }




What am I doing wrong?


Please assist

Thanks
Posted

Message Box is a part of Windows form application, and you are trying to use in Web form application, that's why its not appearing in you in Intellisense.
 
Share this answer
 
Comments
Member 10744248 23-Aug-14 6:13am    
What is the equivalent in the web ?
Tejas Vaishnav 23-Aug-14 6:25am    
You can show javascript alert widow instead of Message Box.
please refer this link to get how to call javascript function from code behind

http://www.aspdotnet-suresh.com/2012/04/aspnet-show-alert-message-from-code.html
If this is ASP.NET as you say, then that implies a website: and MessageBox doesn't work on websites because it would appear at the server, not the client.

Hence Intellisense doesn't offer it as an option...
 
Share this answer
 
Comments
Member 10744248 23-Aug-14 6:15am    
How do accomplish this task in the web?
OriginalGriff 23-Aug-14 7:19am    
Normally you wouldn't: a MessageBox type notification on WinForms is generally a notice that there is a problem with validation or similar, and that is often handled via the client side Javascript rather than round-tripping to the server.

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

  Print Answers RSS
Top Experts
Last 24hrsThis month


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