Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP.NET 2.0 > ASP.NET 2.0 Basics
Password Reminder
Register
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
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 tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old January 19th, 2009, 04:56 PM
Friend of Wrox
 
Join Date: Mar 2007
Location: West Palm Beach, Florida, USA.
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..
Reply With Quote
  #2 (permalink)  
Old January 19th, 2009, 05:17 PM
Lee Dumond's Avatar
Wrox Author
Points: 4,942, Level: 29
Points: 4,942, Level: 29 Points: 4,942, Level: 29 Points: 4,942, Level: 29
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jan 2008
Location: Decatur, IL, USA.
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(); 
}
Reply With Quote
  #3 (permalink)  
Old January 19th, 2009, 05:48 PM
Friend of Wrox
 
Join Date: Mar 2007
Location: West Palm Beach, Florida, USA.
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.
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


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



All times are GMT -4. The time now is 09:27 PM.


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.