Wrox Programmer Forums
|
ASP.NET 2.0 Basics If you are new to ASP or ASP.NET programming with version 2.0, this is the forum to begin asking questions. Please also see the Visual Web Developer 2005 forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 2.0 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 January 19th, 2009, 04:56 PM
Friend of Wrox
 
Join Date: Mar 2007
Posts: 205
Thanks: 4
Thanked 0 Times in 0 Posts
Default ASPNET_MsgBox - confirm

I am using the ASPNET_MsgBox confirm feature in my code behind:

Code:
 
Message = "Dcoument already exists. Do you want to replace?"
Page.ClientScript.RegisterStartupScript(Page.GetType(), Guid.NewGuid().ToString(), "confirm(""" & Message & """)", True)
The pop up shows the OK or Cancel options. Using this technique how can I capture the response (from client to server)? I've been reading so many articles and getting more confused, have not found one post that fits my need. Thank you.

Last edited by snufse; January 19th, 2009 at 05:19 PM..
 
Old January 19th, 2009, 05:17 PM
Lee Dumond's Avatar
Wrox Author
 
Join Date: Jan 2008
Posts: 923
Thanks: 12
Thanked 166 Times in 162 Posts
Default

Try return confirm. If the user clicks OK, the returned value would be "true" and the event will fire. If the user clicks Cancel, the returned value is "false" and the event won't fire.
__________________
Visit my blog at http://leedumond.com
Follow me on Twitter: http://twitter.com/LeeDumond

Code:
if (this.PostHelpedYou)
{
   ClickThanksButton(); 
}
 
Old January 19th, 2009, 05:48 PM
Friend of Wrox
 
Join Date: Mar 2007
Posts: 205
Thanks: 4
Thanked 0 Times in 0 Posts
Default

Do I need to define a hidden button to capture the response or can I do this straight in the code behind. Could you give me an exmaple? Thank you.





Similar Threads
Thread Thread Starter Forum Replies Last Post
[Resolved] ASPNET_MsgBox hides grid view snufse ASP.NET 2.0 Basics 2 October 9th, 2008 01:01 PM
Confirm in ItemDataBound rstelma ASP.NET 1.0 and 1.1 Basics 3 December 6th, 2006 02:10 AM
Confirm messagebox edwin.debrouwere ASP.NET 2.0 Basics 0 September 5th, 2006 07:29 AM
confirm crmpicco Javascript How-To 2 February 7th, 2005 01:23 PM





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