473,811 Members | 2,856 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

What's the right way to add a popup Confirm in ASP.Net 1.1??

I need to get the user to confirm a button push/postback with a popup from
the browser, in ASP.NET 1.1. What's the right way to wire that up?? Thanks
Nov 26 '06 #1
4 2269
"ChrisA" <Ch****@discuss ions.microsoft. comwrote in message
news:08******** *************** ***********@mic rosoft.com...
>I need to get the user to confirm a button push/postback with a popup from
the browser, in ASP.NET 1.1. What's the right way to wire that up??
Thanks
MyButton.Attrib utes.Add("oncli ck", "return confirm('Are you sure?');");

When you upgrade to ASP.NET 2, you can use the OnClientClick tag of the
<asp:Buttoncont rol.
Nov 26 '06 #2
Hi Mark Rae

Well I am not an expart of this things. But you see Asp.net 2.0 is
giving you an opportunity to specify client side code in
"OnClientCl ick" property of asp.net 2.0 Button or Image Button.

So its better to use this property very often. But you see if your
button acts differently when you post back a page, and you need to bind
different onclick client function depending on context. In that case
you need to use Button.Attribut es.Add("onclick ","function();" ); to make
it work the way you want.

If you are using a button which always serve one purpose, that is
confirm javascript dialog. In asp.net 2.0 I would use the OnClientClick
property in the designer to specify my client side code.

Md. Masudur Rahman
www.kaz.com.bd
KAZ Software Ltd.
Software outsourcing made simple...

Mark Rae wrote:
"ChrisA" <Ch****@discuss ions.microsoft. comwrote in message
news:08******** *************** ***********@mic rosoft.com...
I need to get the user to confirm a button push/postback with a popup from
the browser, in ASP.NET 1.1. What's the right way to wire that up??
Thanks

MyButton.Attrib utes.Add("oncli ck", "return confirm('Are you sure?');");

When you upgrade to ASP.NET 2, you can use the OnClientClick tag of the
<asp:Buttoncont rol.
Nov 27 '06 #3
"ChrisA" <Ch****@discuss ions.microsoft. comwrote in message
news:08******** *************** ***********@mic rosoft.com...
>>I need to get the user to confirm a button push/postback with a popup from
the browser, in ASP.NET 1.1. What's the right way to wire that up?? Thanks

MyButton.Attrib utes.Add("oncli ck", "return confirm('Are you sure?');");

When you upgrade to ASP.NET 2, you can use the OnClientClick tag of the
<asp:Buttoncont rol.
For linkbuttons, use

MyLinkButton.At tributes.Add("o nclick", "if(!confirm('A re you sure?'))
return false;");

The reason: asp.net adds it's own "onclick" javascript code to that
linkbutton, which doesn't get run when you use the 'return confirm'
version. And for the same reason, don't forget the closing ";" after
the javascript code!

Hans Kesting
Nov 27 '06 #4
"Masudur" <mu*****@gmail. comwrote in message
news:11******** **************@ j44g2000cwa.goo glegroups.com.. .
Well I am not an expart of this things. But you see Asp.net 2.0 is
giving you an opportunity to specify client side code in
"OnClientCl ick" property of asp.net 2.0 Button or Image Button.
Did you actually read my reply? If not, please read it.

And then read it again.
Nov 27 '06 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
25367
by: Padam Jain | last post by:
i m populating some records by using DataGrid and i have put delete option as item template. now on click of delete i want to popup confirm message box. Please provide me solution. its very urgent Padam
13
5857
by: dave yan | last post by:
hi, i have some forms which use javascript for data validation, e.g., checking to make sure all required fields are completed, checking that data falls within valid ranges for certain fields, etc. if an error occurs, i'm sending the user a message via the alert window. the form is then not submitted until the errors are corrected. however, i've discovered that some users using the aol browser are
2
47693
by: dzeeq | last post by:
Hi, I wonder if it's possible to replace standard text on confirm-popup buttons from 'ok' and 'cancel' to some other captions. If not, is there a way to create quickly custom dialog, with only two buttons, returning 'true' or 'false'? Would I have to use forms to return value from my custom dialog? Thanx for any help.
3
2850
by: Doug O'Leary | last post by:
Hey, all; Apparently, I'm missing the concept. I'm writing a web app in perl to manage nagios configuration files. One of the things I'd like to do is to confirm an update via a popup window prior to writing out changes. My first whack at that goal isn't working out too well. I have the following javascript in one of the pages:
8
4215
by: Steve | last post by:
I need to perform some special initialization of a menu when it is displayed, so I am looking for the WM_INITMENUPOPUP so that I can modify my menu before it appears. Unfortunately WM_INITMENUPOPUP doesn't provide the most basic information that you would need with this function - the menu being displayed! For example, assume I have an app with these menus: File, Edit, and Help and you trap the WM_INITMENUPOPUP message and pull out the handle...
7
2606
by: Drew Berkemeyer | last post by:
Hello, We have an application that we have written using ASP.NET. On one of our pages we open a popup window using javascript. The popup window has a save and a cancel button. Both of them are server-side controls and do a postback. While processing on the server we add javascript to the page load (i.e. onload=window.opener.focus(); window.close()). However, the window.close() command does not close the IE popup window. This happens...
0
1166
by: aaa | last post by:
I am at my wits end I an trying to pass a couple of values to a page with a UC (parent) from a popup (child). But only after a JS confirm on the child popup. Seems straight forward. I have only been able to get half working on either side but not the whole package. I have tried full client side JS, I have tried RegisterClientScriptBlock ( think this is the more viable option ). Any help would be appreicated.
2
1111
by: Helter Skelter | last post by:
hey everybody... (hey dr. nick!), i have a large form and i want people to be able to reset it. i dont, however, want people to accidentally click the reset button. is it possible for a very small popup to open and ask if they want to clear the form? is this possible without being blocked by a popup blocker? thanks in advance -- Look Out!
4
14509
by: John Straumann | last post by:
Hi all: I have an ASP.NET form that submits info to the server, but the customer wants a confirmation window to open when the user clicks "Submit", and then the user would have to click "OK" on the popup window to have the main form submit. I found some samples of using JavaScript to create a popup window, but then the OnClick event for the form button runs the JavaScript as opposed to the server side code. Can anyone suggest how I...
0
9603
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10379
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
9200
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7664
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6882
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5550
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5690
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4334
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
3015
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.