Wrox Programmer Forums
Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP.NET 1.0 and 1.1 > ASP.NET 1.0 and 1.1 Basics
|
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 June 11th, 2004, 04:13 AM
Friend of Wrox
 
Join Date: Sep 2003
Posts: 121
Thanks: 0
Thanked 0 Times in 0 Posts
Default A Yes/No dialog equivalent under asp.net

Under an .aspx page I need to ask the user a simple question eg
Proceed or Cancel ? Is there any kind of Windows forms MessageBox
equivalent under the asp.net (written with vb.net) ? Or do I have to always do a postback and display some kind of panel with Yes/No buttons? What's the best design for this sort of thing?
TIA
Chas, Canterbury UK
 
Old June 11th, 2004, 08:02 AM
planoie's Avatar
Friend of Wrox
 
Join Date: Aug 2003
Posts: 5,407
Thanks: 0
Thanked 16 Times in 16 Posts
Default

You are limited to the capabilities of HTML for this I'm afraid. There is the client side "confirm()" method, but this returns only to the client. You'd need to capture the return in client-side script and use this is some way to cause a postback so you know at the server that something happened. Alternatively, as you mentioned, you could create a new window to serve as a "dialog" that has the confirmation within it. Then you have to figure out how to link the two together. That's about all you can do.

Depending on what capabilities you are allowing for the client side code, you could make a nicer looking "dialog" using some DHTML that is on the same page. This dialog layer could then float on top of the rest of the page. Because the layer is still part of the page it's living on, the controls in it could be standard server controls (buttons). When you answer the dialog it causes a postback and the result of the dialog (yes or no) could be handled as a server event.
 
Old June 11th, 2004, 09:27 PM
Friend of Wrox
 
Join Date: Nov 2003
Posts: 1,285
Thanks: 0
Thanked 2 Times in 2 Posts
Default

Here is an example of Peter's idea that I often use:

<form ...>
<input type=submit onclick="if(confirm('Are you sure?'))hiddenfield.value=true;else hiddenfield.value=false;this.form.submit()">
<input type=hidden id=hiddenfield value=''>
</form>

HTH,

Snib

<><





Similar Threads
Thread Thread Starter Forum Replies Last Post
ASp.net dialog box monika.vasvani ASP.NET 1.0 and 1.1 Professional 2 January 7th, 2008 10:32 AM
Server Includes - ASP.Net equivalent rit01 ASP.NET 2.0 Basics 2 February 21st, 2006 10:31 AM
call window dialog component with asp.net/vb.net s3ng ASP.NET 1.x and 2.0 Application Design 0 June 21st, 2005 04:54 AM
SAVE dialog in ASP.NET(VB.NET) sajid_pk ASP.NET 2.0 Basics 1 June 15th, 2005 10:40 AM





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