How to add a confirm box during process ?

Hi all,

Normally we call out a confirm box when we clicked on a button.

Now what I want is when a user clicked click on a button and pop up a confirm box when certain condition has met.

Anyone know how to accomplish this issue ?

0
zhixuen
5/5/2009 4:14:03 AM
asp.net.getting-started 91979 articles. 2 followers. Follow

5 Replies
995 Views

Similar Articles

[PageSpeed] 33

Try this: 

<script type="text/javascript">

function MyFunction()
{
  if(a == a) /* your condition here */
  {
    var con = window.confirm('I popup only when a condition is specified?');
  }

  if ( con == true )
       return true;
  else
       return false;
}

</script>

 Call it using

<asp:Button runat="server" ID="btn1" Text="PopMe" OnClientClick="MyFunction()" />


ASP.NET Grid With Excel Capabilities | 27 GridView Tips & Tricks | Hosting your site? | SQL Server Tips
0
Suprotim
5/5/2009 5:03:26 AM

Hi,

If you can check that condition in client side then have that validation in javascript and show confirm. If not then have that validation in server side and register client script. If you are using script manager then it shud be scriptmanager.registerstartupscript else clientscript.registerstartupscript


Thanks And Regards,
Fayaz
Chennai, India


Please remember to click “Mark as Answer” on the post that helps you
0
fayaz_3e
5/5/2009 5:09:05 AM

where and what is your conditions? does it required alot of logic and also checking against db?

actuatlly you can achieve that by just using javascript to check the things you need and prompt a confirmation box when necessary

0
mo
5/5/2009 5:10:58 AM

hi..

you can call confirm like this..from code file as per your conditions..

Response.Write("<script>window.confirm('hello')</script>");

or if your page is under AJAX update panel than instead Response.Write

ScriptManager.RegisterStartupScript(this, this.GetType(), "key", " window.confirm('hello');", true);

Hope this helps..


Rushik
(please mark as an answer, if this helps you.)
0
rushik
5/5/2009 5:28:15 AM

Thanks guy the problem resolved.

I tried to use the modal popup to accomplish it.

 Thanks the reference provided, that was good information to me for learning.

 Thanks Smile

0
zhixuen
5/5/2009 6:00:00 AM
Reply:

Similar Artilces:

Getting Start With .net
hi i'm intersted to learn asp.net (vb or delphi) . i programming with delphi6 but i'd like to tp know something about programming in internet specially with .net . i hear about microsoft.net with delphi 7 that i can programming with delphi in .net .... is it right ? what 's our opinian about it ? and better to learn Vb.Net or continu with delphi(or delphi.net) thanks. Ali Darabian I think there is some support for Delphi in .Net. However, you will find much more support from the user community if you choose a more popular language such as VB.Net or C#. Since your al...

how to get start with .NET
the net help people installed  to my desktop 1-microsoft visual studio .NET enterprise developer 2003 2-microsoft .NET framework 1.1 what else do i need ...???  and how can i try with some simple code in VS.Net and run it to see wat happen...????? please help If you want to develope web applications, then you'll also need IIS on your PC.  That'll require XP-Professional or Windows 2000/2003, but XP-Home edition won't allow IIS installation. As for how to get started, you can search the web for some tutorials or buy a good book on VS.  The topic is way too vast to...

Where to start and how did you get started?
Hi, I have had a feeling for a long time to jump into the adds market for some time due to my low income (shooting for the stars) and I don't have anything better to do these days. But I find it really difficult not to give up due to lack of guides (what I can find atleast) and all the hard words which only makes me confused. But I won't give up. Never. Not sure if this is the right place to post this, but I deffinitly would be really greatfull for help getting started. How did you get started? +If there are any teacher that wanna show me the ropes private, I can give payment with ...

Getting started .net website
Hi folks,Does anyone here know of a good website to just sit back and read for learning .net? Thanks in advance.Baldeep Right here... Click the Get Started and Learn sections here. Quite a few out there - - this one, has a lot of good videos -  also ASPNet101.com, but then, I might be a little prejudiced David WierMCP/ASPInsiderASPNet101.com - where to look first!Please Vote for ASPNet101 - 'Best Community Resource'!Control Grouper - easily control properties for multiple controls with one control!Calendar Express - The Best HTML Calendar Generator on the web!(P...

Getting started with JScript.NET
I'm a Javascript and Actionscript developer, and the thought of being able to do server-sides in something I know was too good to resist. Does anyone know some good tutorials for developing ASP.NET pages in JScript?  I can find lots of console code, but simple things are hard: like I can't even figure out how to print something out to the web page (just a string). What I'm really trying to do is access a database, verify a login, and print JSON out to the response.  What should I do to start?  Is there a better way to do this? (IE: using some JSON library already?). I'm commun...

How do I get started with AJAX.Net?
Hi All, I'm a seasoned asp.net developer but have not yet ventured into atlas et al.  I prefer books, but will take whatever I can get if it's good and will get me going. Any recommendations? Thx in advance. Jeff try here first http://ajax.asp.net/downloads/default.aspx?tabid=47 then learn from sample and docJames Wu (MIB426).NET is only way to goMCP, MCSE, MCDBA, MCSD, MCAD I find the materials online display features and implementations but are lacking architectural depth, and am seeking more comprehensive resources. By architectural depth, I mean that I cannot watch ...

Add a confirmation dialog before processing...
I'm trying to add a confirmation dialog box before processing code from a drop down. My dropdown list: <asp:DropDownList ID="drpSelAction" Runat="server" OnSelectedIndexChanged="drpSelAction_SelectedIndexChanged" AutoPostBack="True" ToolTip="Select Action"> <asp:ListItem Text="Select Action..." Value="" /> <asp:ListItem Text="" Value="" /> <asp:ListItem Value="Edit Move Project" /> <asp:ListItem Text="" Va...

Getting Started with .net and a few questions
Hello I've done some asp and php programming along with various other languages in the past and slowing getting my head around .net.I have a small project of creating a Holiday Booking system on our Intranet and just trying to get the first part to work properly will hopefully get me sorted for the whole project. The Intranet is running on .net 2 and I prefer to use the VB code rather than C#. This is connecting to an SQL server.My initial page that I am trying to create is just for an admin user to view which dates in a table have been specified as Bank Holidays and be able to add ...

Dialog box for Password Bank Console add-on for recent upgrade won't quit poping up; even after I agreed to install the console and another box confirmed installation.
Name: Gary Knudson Email: gknudsonatharbornetdotcom Product: Firefox Summary: Dialog box for Password Bank Console add-on for recent upgrade won't quit poping up; even after I agreed to install the console and another box confirmed installation. Comments: This box pops up every 5 minutes or so and totally disrupts any use of my computer. If this is not fixed immediately, I will be forced to revert to IE7 and or uninstall Firefox. The problem began today (1/4) as I dutifully installed your latest upgrade. Browser Details: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv...

Developed C#.net WebService 1.1 for Client C#.net 1.1. Getting error "Server was unable to process the Request" Pls Help
Hi., I developed Microsoft C#.net Web Services2003 for the Client Application C#.net 2003. When it runs in 5 machines it gives good performance and has no errors. But if i run the same application in about 80 client machines. Getting error "Server was unable to process the request". I use Sql Server 2005 as my database. I get error even when i login at a time for about 25 users. Tried modifying machine.config too. But went unsuccessful. Live Server is 2003 using IIS 6.0 I use very expensive data handling.  Its very urgent pls help. Have to post in Live Server. Thank u., ...

Opportunity to get Started with Add-On Writing
Zach Lipton and Ben Hsieh created the QA Companion Add-On[1]. This is an extension that sits in a little window outside Firefox or Thunderbird and helps you to run litmus tests [2] against the application. It has helped hundreds of people when testing Firefox, and has become a central part of our QA Test Day events. Both Zach and Ben are students and they're busy with school, so maintaining the Add-On has fallen to me. I can keep up with the maintenance on this, but that's really not enough. The QA Companion has great potential, lots of people have thought about wa...

Server Function - Confirmation Box
Hi, Can some one help me with this? I have a GridView on one of the pages, the last column is a button column, when the button is clicked, I will use the primary key of the active record to check if the information for this record in the database is sufficient, if not, a confirmation box will pop up and says something like:"Your information is not enough, do you want to continue?", if people chooses to stop here, they can click "Cancel", or they can choose to click "Ok" to submit(postback). I know this is sounds simple. I found some information online about...

Getting Started Without VS.NET
Hi all, does anyone know how any online resources that can show me how to create web apps that include code-behind, and uer controls without using VS.NET? I have VS.NET in work, but would also like to do work at home, but cannot install VS.NET on my home laptop because I simply dont' have the space or processor power. Any online articles would be welcome, as will any open-source apps - I currently have SharpDevelop, but I find it unstable as it crashes my laptop alot of the time. Thanks Tryst Did you try Web Martix? It is a FREE tool from Microsoft.Regards, Narayana ...

process.start in .NET class library
I have a strong named .NET class library project in the GAC which is being called as an exit and am trying to execute a process.start command as follows: EventLog.WriteEntry("Inventory PDR", "Before New Process.Start")Process.Start("IExplore.exe", "http://server/Inventory/add_pages/Preliminary_Delivery_Approval.aspx")EventLog.WriteEntry("Inventory PDR", "After New Process.Start")While the eventlogs execute, the process.start refuses to run and open a new process. I have tested this from the RUN command and as expected it works fine (i.e. the page is valid etc.)Though I have a iexplorer wind...

Web resources about - How to add a confirm box during process ? - asp.net.getting-started

Facebook Confirms Streamlined Post Scheduling, Announces Easier Photo Uploading For Page Admins
Facebook officially announced the improvements to the post-scheduling process that began leaking out last week, as well as an easier way for ...

4th XMRV Study Fails to Confirm Association with CFS - Facebook
The CFIDS Association of America hat eine Notiz mit dem Titel 4th XMRV Study Fails to Confirm Association with CFS geschrieben. Du kannst den ...

Slide Confirms Cuts to Ad Sales Staff, Continues to Shift Focus
Late last month, we reported that direct to consumer virtual goods sales were now accounting for at least half of Slide’s revenues, and that ...

Confirm Biosciences (@ConfirmBio) on Twitter
Log in Sign up You are on Twitter Mobile because you are using an old version of Internet Explorer. Learn more here Confirm Biosciences @ ConfirmBio ...

YouTube - Halle Berry talks The Call and confirms X-Men Days of Future Past
Veröffentlicht am 02.03.2013 Tinsel Talk: The Call Exclusive interview with Halle Berry. BlackTree TV's Jamaal Finkley talks to Halle Berry ...

Disney confirms that Star Wars: Episode 7 is filming in Abu Dhabi desert
Disney yesterday confirmed that the filming of Star Wars: Episode 7 is taking place in the desert in Abu Dhabi.

Iran sanctions lifted by US, EU after UN watchdog confirms cooperation in nuclear deal
... to be lifted and the landmark accord to enter into force. The United States received an International Atomic Energy Agency (IAEA) report confirming ...

42% OF AMERICANS NOW REJECT 2-PARTY SYSTEM: Confirm That Government is the Problem
By Claire Bernish More people in the United States than ever are breaking away from the political duopoly by refusing to self-identify as either ...

Embassy confirms "several" Americans missing in Baghdad
Local media reported three Americans kidnapped by militias in Iraqi capital; ISIS has claimed string of recent attacks in city

Indian Wind Energy Giant Suzlon Energy Confirms 210 MW Solar Power Win
... bidder in what was India’s single largest solar power tender. State authorities in the [&hellip Indian Wind Energy Giant Suzlon Energy Confirms ...

Resources last updated: 1/18/2016 12:08:21 AM