Click here to Skip to main content
15,884,014 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi all,

I'm working about an asp.net project. i want to use something like MessageBox in code behind. Do you know the easiest way like that?
-Javascript function is not useful for me
-i've control in my code behind code. if eveything is success, i want to show "successfull insert" etc. like that
Posted
Updated 4-Jan-12 5:38am
v4

You have to use javascript to show a message box alert to the end user. If you use a MessageBox in your code-behind, then it will pop up on the server hosting your site and that is a very bad thing.
 
Share this answer
 
Comments
Abhinav S 4-Jan-12 13:08pm    
Valid. 5.
Espen Harlinn 4-Jan-12 16:03pm    
5'ed - and a small sidenote:
http://www.codeproject.com/KB/custom-controls/asppopup.aspx
It works quite well, and it is a viable solution if you are not familiar with javascript.
fjdiewornncalwe 4-Jan-12 17:24pm    
Good point. I remember that one.
Espen Harlinn 4-Jan-12 17:25pm    
Glad you liked it, Marcus!
Have a look at:
ASP.NET Popup Control[^]
and
ModalPopup example[^]

Best regards
Espen Harlinn
 
Share this answer
 
Comments
Monjurul Habib 4-Jan-12 13:07pm    
5!
Espen Harlinn 4-Jan-12 16:00pm    
Thank you, Monjurul :)
Abhinav S 4-Jan-12 13:08pm    
5!
Espen Harlinn 4-Jan-12 16:00pm    
Thank you, Abhinav :)
 
Share this answer
 
Comments
Monjurul Habib 4-Jan-12 13:07pm    
5!
RaviRanjanKr 4-Jan-12 13:13pm    
Thanks :)
Abhinav S 4-Jan-12 13:08pm    
Good link 5!
RaviRanjanKr 4-Jan-12 13:14pm    
Thanks :)
 
Share this answer
 
Comments
Abhinav S 4-Jan-12 13:08pm    
More links. 5.
Monjurul Habib 4-Jan-12 13:32pm    
thank you
Add this statement in your code behind file..

Page.RegisterStartupScript("Info", "<script>alert('Record Successfully submitted')</script>");

Hope it helps you...
 
Share this answer
 
v2
Comments
CHill60 12-Nov-13 14:46pm    
Did you realise that this question is nearly 2 years old and already has 4 solutions with 5 stars?
Tilak Rathour 12-Nov-13 23:04pm    
Hey Chill..
By your statement what you want to say...you are behave like a kid.
always remember
'if you judge me, make sure you are perfect...'
CHill60 13-Nov-13 4:51am    
I was only pointing out to you that the question had already been adequately answered several months ago, and asked if you had realised this. Solutions posted to old questions, unless they add some material substance to previously submitted solutions, attract down-votes and reports (I see this has already happened). If my comment is deemed as a "judgement" then I'm with Henry James on that subject.

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