Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: ASP.NET2.0
how to code for confirm box in code behind file of c#.net...if i click yes it should redirect to index.aspx page if i click no it should remain in same page.can anyone help me
Posted 30-Dec-12 14:45pm
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 2

I am totally agree with Christian Graus. But we can have an alternate option for it. For a simple confirmation box we can show a ModelPopupExtender with two buttons saying Confirm and Cancel.
See a sample confirm box:
ASP.NET AJAX ModalPopup to Confirm Delete[^]
 

--Amit
  Permalink  
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

You need to read a BASIC ASP.NET book. You can't show UI in your code behind, as it runs on the server. Your client won't see it. You need to do it with javascript. If you need to calculate if you do it, on the server, the best way is to use AJAX to find out. Otherwise, do it on the client and redirect from there.
  Permalink  

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
0 Sergey Alexandrovich Kryukov 353
1 OriginalGriff 304
2 George Jonsson 258
3 Shemeemsha RA 138
4 Animesh Datta 130
0 OriginalGriff 5,985
1 Sergey Alexandrovich Kryukov 5,341
2 CPallini 4,760
3 George Jonsson 3,400
4 Gihan Liyanage 2,522


Advertise | Privacy | Mobile
Web04 | 2.8.140916.1 | Last Updated 30 Dec 2012
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100