I have a registration page in which i ask the user to register their details. After registration i need to display a message saying "Registration successfull".
(1) First i want to know what are the different ways in which this can be done. In windows apps i have used MessageBox.Show(). What about ASP.NET?
(2)I have also seen in certain forums that when you register registration is shown to be successfull for a few seconds and then the user is taken to the respective page.? Is this possible using ASP.NET ? If yes how?
(1) First i want to know what are the different ways in which this can be done. In windows apps i have used MessageBox.Show(). What about ASP.NET?
You can use JavaScript alert for that
alert("Registration successfull");
achuthan1988
(2)I have also seen in certain forums that when you register registration is shown to be successfull for a few seconds and then the user is taken to the respective page.? Is this possible using ASP.NET ? If yes how?
You can use asp:CreateUserWizard and set the ContinueDestinationPageUrl to the particular page. Like below
i just got a blank page. didnt see even the button?
You just double clicked on the page? If so, it won't work because of the runat="server" tags. Remove them and try again or run that page through Visual Studio.
achuthan1988
Member
53 Points
159 Posts
How to display message boxes in asp.net?
May 06, 2012 09:56 AM|LINK
I have a registration page in which i ask the user to register their details. After registration i need to display a message saying "Registration successfull".
(1) First i want to know what are the different ways in which this can be done. In windows apps i have used MessageBox.Show(). What about ASP.NET?
(2)I have also seen in certain forums that when you register registration is shown to be successfull for a few seconds and then the user is taken to the respective page.? Is this possible using ASP.NET ? If yes how?
nirman.doshi
Participant
1520 Points
775 Posts
Re: How to display message boxes in asp.net?
May 06, 2012 10:17 AM|LINK
You can do it using JavaScripts:
use "alert("Registration successful");" java script function in appropriate client-side event of your page/ control.
Software Developer
Vadodara, India
Ruchira
All-Star
42943 Points
7024 Posts
MVP
Re: How to display message boxes in asp.net?
May 06, 2012 10:20 AM|LINK
Hello,
You can use JavaScript alert for that
alert("Registration successfull");You can use asp:CreateUserWizard and set the ContinueDestinationPageUrl to the particular page. Like below
<asp:CreateUserWizard ID="CreateUserWizard1" Runat="server" ContinueDestinationPageUrl="~/Default.aspx">
My Tech blog | My YouTube ChannelPlease 'Mark as Answer' if this post helps you.achuthan1988
Member
53 Points
159 Posts
Re: How to display message boxes in asp.net?
May 06, 2012 10:24 AM|LINK
Can you tell me how to add javascript into your code . I know that you have add some tags(i am new to asp).
Ruchira
All-Star
42943 Points
7024 Posts
MVP
Re: How to display message boxes in asp.net?
May 06, 2012 10:27 AM|LINK
Hi,
Write your javascript code inside <script> tags.
My Tech blog | My YouTube ChannelPlease 'Mark as Answer' if this post helps you.achuthan1988
Member
53 Points
159 Posts
Re: How to display message boxes in asp.net?
May 06, 2012 10:29 AM|LINK
i want the message to appear on clicking the button. So where should i place this and how will it fire on the button click event?
esmerman
Member
24 Points
73 Posts
Re: How to display message boxes in asp.net?
May 06, 2012 10:33 AM|LINK
<html xmlns="http://www.w3.org/1999/xhtml"> <head runat="server"> <title></title> <script language="javascript" type="text/javascript"> function alertMsg() { alert("Hello"); } </script> </head> <body> <form id="form1" runat="server"> <div> <input type="button" value="Successfull!" onclick="alertMsg()" /> </div> </form> </body> </html>achuthan1988
Member
53 Points
159 Posts
Re: How to display message boxes in asp.net?
May 06, 2012 10:39 AM|LINK
i just got a blank page. didnt see even the button?
Ruchira
All-Star
42943 Points
7024 Posts
MVP
Re: How to display message boxes in asp.net?
May 06, 2012 10:43 AM|LINK
You just double clicked on the page? If so, it won't work because of the runat="server" tags. Remove them and try again or run that page through Visual Studio.
My Tech blog | My YouTube ChannelPlease 'Mark as Answer' if this post helps you.esmerman
Member
24 Points
73 Posts
Re: How to display message boxes in asp.net?
May 06, 2012 10:51 AM|LINK
<script language="javascript" type="text/javascript"> function alertMsg() { alert("Hello"); } </script>and <body> section