How To Show Error Message In Popup Window In Asp.net
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us Learn more about Stack Overflow the company Business Learn more about hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 4.7 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up Asp.Net popup error message up vote 2 down vote favorite Is there a way I can display an error message in a popup box? I'm using Asp.Net (C#), and on our webpage, if an order goes throug incorrectly we display an error message. Now, we would like to be able to do so using some sort of pop-up method (maybe Ajax?) - it should be able to take a string value to display the error message. c# asp.net ajax popup share|improve this question asked Oct 31 '11 at 13:54 Hani Honey 85663060 What do you display to the user if the order goes through correctly? –Richard Everett Oct 31 '11 at 13:59 They are directed to a new page that says "Thank you for ordering...." etc. –Hani Honey Oct 31 '11 at 19:11 And if the order fails, are you going to keep them at the order page, or direct them to a new page? –Richard Everett Oct 31 '11 at 19:12 Keep them at the same page, the order page. –Hani Honey Nov 8 '11 at 18:31 add a comment| 3 Answers 3 active oldest votes up vote 4 down vote accepted For a simple approach, you can have a script block that contains alert("your error message"). If you want the popup to be styled as the rest of your website then you could render your error message into a div element and use a jQuery dialog to display it as a modal dialog within your page. share|improve this answer edited Oct 31 '11 at 14:16 answered Oct 31 '11 at 13:56 Richard Everett 25.9k36141240 Can I display that using C# conditionally? If X then "display alert"? –Hani Honey Oct 31 '11 at 13:57 1 @OhMisterRabbit you can do this from code
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us Learn more about Stack Overflow the company Business Learn more about hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 4.7 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up How to create a pop-up message box http://stackoverflow.com/questions/7954663/asp-net-popup-error-message to display error message in .net c# web-applications up vote 1 down vote favorite Does anyone know how can I create a pop-up message box in server side, so that it will display the error message in the pop-up message box when save process is failed? Example: protected void btnSave_Click(object sender, EventArgs e) { try { using (TransactionScope scope = new TransactionScope()) { //save process scope.Complete(); Response.Redirect(url); http://stackoverflow.com/questions/6092097/how-to-create-a-pop-up-message-box-to-display-error-message-in-net-c-sharp-web } } catch (TransactionAbortedException ex) { //pop-up message box to show error message } catch (ApplicationException ex) { //pop-up message box to show error message } } How can I able to create a pop-up message box within the catch to pop-up the error message box to the user when the save process is failed? c# .net web-applications share|improve this question edited May 23 '11 at 2:03 asked May 23 '11 at 1:53 SkyWeng 11.7k53112146 You want the popup to appear on the server or the client? –Carlos G. May 23 '11 at 1:58 @Kiranu: on the client –SkyWeng May 23 '11 at 2:01 1 @Kiranu - please tell me that was a trick question - you cannot get a message box to pop up on the server! –slugster May 23 '11 at 2:09 @slugster - I know... but it wasn't clear if what he wanted was something that was possible (a popup in the client) or impossible (a form created by a windows service) –Carlos G. May 23 '11 at 3:19 add a comment| 4 Answers 4 active oldest votes up vote 1 down vote accepted Try using either the Page.RegisterStart
ASP.NET Community Standup Forums Help Home/ASP.NET Forums/General ASP.NET/ASP.NET AJAX + Ajax Control Toolkit/Displaying error message in the Ajax modal popup window Displaying http://forums.asp.net/t/1860119.aspx?Displaying+error+message+in+the+Ajax+modal+popup+window error message in the Ajax modal popup window [Answered]RSS 1 reply Last http://www.codeproject.com/Articles/63321/Showing-Validation-ErrorMessages-in-Modal-Popup post Nov 20, 2012 10:31 PM by chetan.sarode ‹ Previous Thread|Next Thread › Print Share Twitter Facebook Email Shortcuts Active Threads Unanswered Threads Unresolved Threads Support Options Advanced Search Related Links GuidanceVideos Reply nsingh12 None 0 Points 3 Posts Displaying error message in the Ajax how to modal popup window Nov 20, 2012 04:30 PM|nsingh12|LINK I am new to .NET and C# world. I'm working on my first project. In my user control, I have a panel (named: PopupContent) which has another panel (named: Message) and 2 buttons for ok and cancel. To the Message panel I added the AjaxControlToolkit custom HTMLEditor. Made the PopupContent how to show panel as modal using ModalPopupExtender. When the ok button is clicked, the C# code executes and a database call is made to update the content coming from custom editor. I am able to update the database. I have a return value from the stored procedure indicating if the update was successful or not. For some reason if the database update call fails I would like to display a message in the modal window indicating that the database update was not successful, before the modal window is closed, as I want the user to give a chance if they want to save the contents typed into the custom editor else where like (word document or a text file). Please let me know how to display the error message from the server side code into the modal window and keep the modal window displayed as it is. Thanks in advance! Reply chetan.sarod... All-Star 48403 Points 12165 Posts Re: Displaying error message in the Ajax modal popup window Nov 20, 2012 10:31 PM|ch
Latest Articles Latest Tips/Tricks Top Articles Beginner Articles Technical Blogs Posting/Update Guidelines Article Help Forum Article Competition Submit an article or tip Post your Blog quick answersQ&A Ask a Question about this article Ask a Question View Unanswered Questions View All Questions... C# questions Linux questions ASP.NET questions SQL questions VB.NET questions discussionsforums All Message Boards... Application Lifecycle> Running a Business Sales / Marketing Collaboration / Beta Testing Work Issues Design and Architecture ASP.NET JavaScript C / C++ / MFC> ATL / WTL / STL Managed C++/CLI C# Free Tools Objective-C and Swift Database Hardware & Devices> System Admin Hosting and Servers Java .NET Framework Android iOS Mobile SharePoint Silverlight / WPF Visual Basic Web Development Site Bugs / Suggestions Spam and Abuse Watch features Competitions News The Insider Newsletter The Daily Build Newsletter Newsletter archive Surveys Product Showcase Research Library CodeProject Stuff communitylounge Who's Who Most Valuable Professionals The Lounge The Insider News The Weird & The Wonderful The Soapbox Press Releases Non-English Language > General Indian Topics General Chinese Topics help What is 'CodeProject'? General FAQ Ask a Question Bugs and Suggestions Article Help Forum Site Map Advertise with us About our Advertising Employment Opportunities About Us Articles » Web Development » ASP.NET » Samples ArticleBrowse CodeStatsRevisions (3)Alternatives Comments (5) Add your ownalternative version Tagged as C#ASP.NETDev Stats 63.5K views2.8K downloads11 bookmarked Posted 4 Mar 2010 Showing Validation ErrorMessages in Modal Popup After2050, 4 Mar 2010 CPOL 3.40 (5 votes) 1 2 3 4 5 3.40/5 - 5 votesμ 3.40, σa 1.01 [?] Rate this: Please Sign up or sign in to vote. The validation error messages of each content page is shown in the common modal popup of master page Download source - 748.33 KB Introduction Hi guys! Here I have tried a sample project of showing the validation error messages of a page in a Modal Popup. The modal popup stays in the Master Page whenever the content page requires to validate the page and show the error messages if there are any... they can accomplish this by calling a method of the master page. I have used Ajax Control Toolkit version 3.0 for this sample. Bits of Code I have created a sample page that consists of few Text Boxes and ASP.NET Validators hooked into it. Every validator control has a property called ValidationGroup. This property is used to group a set of validations to happen at a particular action and to be show