Wrox Programmer Forums
|
ASP.NET 1.0 and 1.1 Basics ASP.NET discussion for users new to coding in ASP.NET 1.0 or 1.1. NOT for the older "classic" ASP 3 or the newer ASP.NET 2.0.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 1.0 and 1.1 Basics section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old July 24th, 2003, 10:22 PM
Registered User
 
Join Date: Jul 2003
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default MessageBox

Please help me to find a way to display messageboxes with a yes or no buttons in ASP.NET and trap its selected value (yes/no).

Thanks

 
Old July 25th, 2003, 11:45 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 996
Thanks: 2
Thanked 11 Times in 11 Posts
Send a message via Yahoo to melvik
Default

see RegisterClientScriptBlock.
HTH

Always:),
Hovik Melkomian.
 
Old July 28th, 2003, 01:23 AM
Authorized User
 
Join Date: Jun 2003
Posts: 12
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via AIM to kashif Send a message via MSN to kashif Send a message via Yahoo to kashif
Default

try this code:


<html>
<body>
<form runat="server">
<asp:TextBox id="txt" runat="server" />
<asp:RequiredFieldValidator id="vld" controlToValidate="txt" runat="server" />
<asp:ValidationSummary
  ShowMessageBox="True"
  HeaderText="There are problems with the following
    form fields:"
  Runat="Server" />
<asp:Button id="btn" Text="Submit" runat="server" />
</form>
</body>
</html>
KASHIF


PEACE
 
Old July 29th, 2003, 03:02 AM
Authorized User
 
Join Date: Jun 2003
Posts: 97
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to planeswalk
Default

Hi,

You can always go with some good-old Javascript. In your server script type in:

  control_name.Attributes.Add("onSubmit", "javascript:return verifyForm();")

Then just put the necessary javascript in the .NET page like so:

  <script language="Javascript">
    function verifyForm() {
      if (condition 1....) {
        return true;
      }
      else {
        return false;
      }
    }
  </script>


Cheers!
Marlon





Similar Threads
Thread Thread Starter Forum Replies Last Post
MessageBox help Barkils C# 1 July 16th, 2007 09:30 PM
MessageBox Lalit Pradhan ASP.NET 2.0 Professional 1 July 5th, 2006 12:03 PM
MessageBox Ric_H General .NET 2 April 19th, 2006 01:45 PM
How to use MessageBox johnsonlim026 ASP.NET 1.0 and 1.1 Basics 7 June 17th, 2005 10:21 AM
Messagebox mh VB.NET 27 March 31st, 2005 01:41 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.