Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
ASP.NET 2.0 Professional If you are an experienced ASP.NET programmer, this is the forum for your 2.0 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 Professional 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
 
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old December 21st, 2005, 07:36 AM
Friend of Wrox
Points: 464, Level: 7
Points: 464, Level: 7 Points: 464, Level: 7 Points: 464, Level: 7
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Dec 2005
Location: Colombo, , Sri Lanka.
Posts: 132
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to nalla Send a message via Yahoo to nalla
Default message box


Hi,

I have added an attribute to a button in page load as,

this.btnHome.Attributes.Add("onclick","if(!confirm ('Are you sure to delete this Event?')) return false;");

and this shows the message box properly with 2 options "Ok" and "Cancel". so i added a condition inside the button's click event as,

if(!confirm('Are you sure to delete this Event?'))
   {

   }
else
   {

   }
but this shows 2 syntax errors as,
(1) The name confirn doesnot exist in the class or namespace ....
(2) Too many characters in the character literal.

how can i return whether user pressed "Ok" or "Cancel"??

nalla


__________________
nalaka hewage
http://nalakahewage.blogspot.com
  #2 (permalink)  
Old December 22nd, 2005, 03:11 AM
Registered User
 
Join Date: Dec 2005
Location: , , .
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to sky_handsome
Default

hi, i have tried to put the if-else statement in a javascript function, then associate this function with OnClick event, then that code works correctly!!

  #3 (permalink)  
Old December 22nd, 2005, 04:35 AM
Friend of Wrox
Points: 464, Level: 7
Points: 464, Level: 7 Points: 464, Level: 7 Points: 464, Level: 7
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Dec 2005
Location: Colombo, , Sri Lanka.
Posts: 132
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to nalla Send a message via Yahoo to nalla
Default



Hi,

I need to do it in my C# code. but anyway it's fine if it's working in java code. can explain bit more how did you do it and post the code?

nalla


  #4 (permalink)  
Old December 22nd, 2005, 09:23 PM
Registered User
 
Join Date: Dec 2005
Location: , , .
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to sky_handsome
Default

<script type="text/javascript">
function doConfirm()
{
    if(!Confirm('ffds'))
    {}
     else
     {}
}
</script>

i put the above code in the aspx file. then i write the following code in c#.
this.Button1.Attributes.Add("OnClick","doConfirm() ");

you can try this. it works well on my machine.

  #5 (permalink)  
Old December 23rd, 2005, 03:00 AM
Friend of Wrox
Points: 464, Level: 7
Points: 464, Level: 7 Points: 464, Level: 7 Points: 464, Level: 7
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Dec 2005
Location: Colombo, , Sri Lanka.
Posts: 132
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to nalla Send a message via Yahoo to nalla
Default



Hi,

Thanx.I'll try that.

nalla



 


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
Message box basie Classic ASP Basics 1 September 4th, 2008 01:09 PM
Message box in C# shikha09 C# 0 November 28th, 2006 01:24 AM
how to use message box? andy hee ASP.NET 1.0 and 1.1 Basics 1 April 18th, 2006 04:53 AM
Yes No Message box dbartelt Access 7 October 28th, 2005 08:16 AM



All times are GMT -4. The time now is 05:53 PM.


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