Click here to Skip to main content
15,997,596 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
sir
I have used the mbox snippets for message box showing.It works fine, but now we wanted to use it with yes/No Condition.OR
Please tell me how to use Message box in Asp.net with yes/No Condition.
Thanking You...
Posted
Updated 20-Jan-12 0:57am
v2

You will have to modify the MessageBox code that the snippet inserts:
C#
MessageBox.Show("Test");
Becomes:
C#
MessageBox.Show("Test", "Caption", MessageBoxButtons.YesNo);
 
Share this answer
 
Comments
kedar1jgd 20-Jan-12 7:44am    
Great man..............thanks a ton
fjdiewornncalwe 20-Jan-12 11:20am    
Somehow you nailed it even though the OP has tagged his question asp.net. In that case, of course the MessageBox will be popping up on the server when the site is deployed to a server. Cheers...
OriginalGriff 20-Jan-12 11:58am    
I don't think it was tagged or referenced ASP.NET when I answered it - might have missed it though.
fjdiewornncalwe 20-Jan-12 13:32pm    
That could very well be. Even though it is tagged as asp.net, it may not be. Since the OP has marked your answer as correct, I'll have to assume that your answer is the right one.
If you are actually using asp.net as your question is tagged, then you will encounter a problem with these message boxes once you deploy the application to a server. The code behind in your application will only run on the server, so the MessageBoxes will also only show on the server.
In an asp.net project, you may wish to adopt a process similar to one of these:
JQuery Message Box Plugin[^]
http://jqueryui.com/demos/dialog/[^]
http://www.karpach.com/Javascript-Alert-Message-codebehind-ASP-NET.htm[^]
http://forums.asp.net/t/1200619.aspx/1[^]
http://www.daniweb.com/web-development/aspnet/threads/116097[^]

I suspect that you have mistagged your question and that this is not relevant, but just in case it is I have provided you this alternative.
 
Share this answer
 
Comments
Uday P.Singh 20-Jan-12 11:29am    
agree 5+

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