p2p.wrox.com Forums

Need to download code?

View our list of code downloads.


Go Back   p2p.wrox.com Forums > ASP.NET and ASP > ASP.NET 2.0 > ASP.NET 2.0 Basics
I forgot my password Register Now
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 p2p Programmer to Programmer discussion community. This is a community of more than 40,000 computer programmers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining our free Wrox p2p community you can post your own programming questions and respond to other programmers’ questions. Registered users also don't have to see the ads that are displayed to guests. Registration is fast, simple and absolutely free so please, join today!
Join today and post to win prizes! Post more to increase your chances of being Wrox’s top poster of the month.

Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old July 2nd, 2009, 11:58 AM
Friend of Wrox
Points: 923, Level: 11
Points: 923, Level: 11 Points: 923, Level: 11 Points: 923, Level: 11
Activity: 5%
Activity: 5% Activity: 5% Activity: 5%
 
Join Date: Mar 2007
Location: West Palm Beach, Florida, USA.
Posts: 198
Thanks: 4
Thanked 0 Times in 0 Posts
Question Confirm Message Box

I have an app where I use Confirm Message Box pop up. The application checks if a report (crystal) alredy exists as a .pdf, if so I show a confirm pop up and if click is OK the I plan to replace existing .pdf (ie save to a folder)

I have following code snippet. The issue is when confirm pop up is displayed, I have to click the OK twice before it enters into the "btnConfirm" sub

Step 1 - Check report exists

Code:
 
Response = CheckDocumentExists(FilePath, DocumentName)
 
If Response(1) = "Yes" Then
MsgBox_Confirm(Response(0))
Step 2 - Report exists, call confirm pop up

Code:
 
Public Overloads Sub ASPNET_MsgBox_Confirm(ByVal Message As String) 'Confirm
Page.ClientScript.RegisterStartupScript(Me.GetType(), "Confirmation", "Confirmation();", True)
End Sub
Step 3 - Handle Response to pop up

Code:
 
<scripttype="text/javascript"language="javascript">
function Confirmation()
{
if(confirm("Daily Sales Report already exists. Do you want to replace it ?")== true)
{
//Calling the server side code after confirmation from the user
document.getElementById('<%=btnConfirm.ClientID%>').click();
}
}
</script>
<asp:ButtonID="btnConfirm"OnClientClick="return Confirmation();"runat="server"style="display: none"Text="Confirm"OnClick="btnConfirm_Click"/>
Step 4 - Action when OK clicked

Code:
 
Protected Sub btnConfirm_Click(ByVal sender As Object, ByVal e As System.EventArgs)
Dim Response As String
Response = "Debug, I reached this point ..."
End Sub
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit!
Reply With Quote
  #2 (permalink)  
Old July 2nd, 2009, 04:33 PM
Friend of Wrox
Points: 788, Level: 10
Points: 788, Level: 10 Points: 788, Level: 10 Points: 788, Level: 10
Activity: 17%
Activity: 17% Activity: 17% Activity: 17%
 
Join Date: Nov 2007
Location: Central Florida, USA.
Posts: 199
Thanks: 2
Thanked 15 Times in 15 Posts
Default This might be unrelated...

This might be unrelated but i would change your variable name from Response to Resp or something else. Response is already denoted as an object. Could be causing a conflict?
__________________
Jason Hall
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit!
Reply With Quote
  #3 (permalink)  
Old July 2nd, 2009, 06:02 PM
Friend of Wrox
Points: 923, Level: 11
Points: 923, Level: 11 Points: 923, Level: 11 Points: 923, Level: 11
Activity: 5%
Activity: 5% Activity: 5% Activity: 5%
 
Join Date: Mar 2007
Location: West Palm Beach, Florida, USA.
Posts: 198
Thanks: 4
Thanked 0 Times in 0 Posts
Default

Jason, I will try to do that but I think my problem is related to the postback somehow. As I said I have to click the OK button twice before it fires the event on the server.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit!
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

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
JavaScript Confirm Box ricespn Classic ASP Basics 1 January 20th, 2007 12:48 AM
Javascript Confirm Message box itHighway Javascript How-To 5 September 25th, 2006 03:51 AM
R (registered) symbol in a confirm box crmpicco Javascript 9 December 5th, 2005 09:07 AM
prob.. confirm message abhit_kumar JSP Basics 0 December 29th, 2004 06:37 AM
Confirm alert box - need help, Please! larry HTML Code Clinic 1 January 25th, 2004 02:07 AM



All times are GMT -4. The time now is 03:21 PM.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
© 2008 Wiley Publishing, Inc