.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
 
Sign In
Register
 
Win Surprise Gifts!!!
Congratulations!!!


Top 5 Contributors of the Month
david stephan

Home >> Forum >> ASP.Net >> Post New QuestionBookmark and Share Subscribe to Forum

How to do Yes or No confirmation messagebox in asp .net

Posted By: Selvaraj Prabhu     Posted Date: September 30, 2009    Points:2   Category :ASP.Net
How to do Yes (or) No confirmation messagebox in asp .net.

Responses
Author: Venkat             
Posted Date: September 30, 2009     Points: 5   

Hi,
You can do with VB script message box with yes or not. javascript does not support Yes no button in slert or confirm message box.


<script language="VBScript">
Dim intAnswer
intAnswer = MsgBox("do you want only YES and NO?", vbYesNoCancel)

If intAnswer = 2 Then' Yes.

ElseIf intanswer = 3 Then' No

End If
</script>


Mark As Answer if this solve your problem
Warm Regards,
Venkat
Author: Amit Mehra             
Posted Date: October 01, 2009     Points: 5   

Hi,
Or you can use JQuery custom message box to display Message Box with Yes No Options...

Thanks,
Amit
Please "Mark As Answer " if this post help you.
Author: Deepika Haridas             
Posted Date: October 01, 2009     Points: 5   

Hi,

You can include windows namespace and directly use messagebox

Author: Syed Shakeer Hussain             
Posted Date: October 05, 2009     Points: 5   

Hi prabhu,

Confirm Message Box:- This type of Message Box is used to give warning to the user.Suppsoe user going to delete records at that time this type of message box is used to give confirmation about the action takes place or not by showing two Buttons as "YES' " and "NO ".If the User click on 'YES' Button it returns Boolean 'True' and for 'NO' button it returns Boolean 'False' .



<html>

<head runat="server">

<title>Untitled Page</title>

<script type="text/Javascript" language ="javascript" >

function confirm_meth()

{

if( confirm("Do you want to continue!Click 'YES'")==true)

{

document.writeln ("<b>You had clic on 'YES' Button</b>");

}

else

{

document.writeln ("<b>You had clic on 'NO' Button</b>");

}

}

</script>

</head>

<body>

<form id="form1" runat="server">

<div>

<asp:Button ID="btnconfirm" runat="server" Font-Bold="True" ForeColor="Red"

Style="z-index: 101;left: 272px; position: absolute; top: 208px" Text="Confrimation MsgBox" OnClientClick =" return confirm_meth()" Width="160px" />

</form>

</body>

</html>




Post Reply

You must Sign In To post reply
 
 
Find more Forum Questions on C#, ASP.Net, Vb.Net, SQL Server and more Here
Quick Links For Forum Categories:
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  OOPs  SilverlightIISJQuery
JavaScript/VBScriptBiztalkWPFPatten/PracticesWCFOthers
www.DotNetSpark.comUnAnsweredAll

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend