smriti Posted February 10, 2005 Posted February 10, 2005 hi i want to display a message like added successfully in the same form after clicking a button and redirect to other form. how this message gets displayed . plz help Quote
stustarz Posted February 10, 2005 Posted February 10, 2005 you can use the javascript alert function to display a message box to the user: <script language="Javascript"> <!-- alert ("Message goes in here") //--> </script> Quote Visit: VBSourceSeek - The VB.NET sourcecode library "A mere friend will agree with you, but a real friend will argue."
smriti Posted February 10, 2005 Author Posted February 10, 2005 you can use the javascript alert function to display a message box to the user: <script language="Javascript"> <!-- alert ("Message goes in here") //--> </script> i want to display it as text not as message box Quote
stustarz Posted February 10, 2005 Posted February 10, 2005 In that case, you could use a label control and set its text property to your desired text when the button is clicked, using the onclick event: Me.Label1.text = "Successful" 'Or something like this Quote Visit: VBSourceSeek - The VB.NET sourcecode library "A mere friend will agree with you, but a real friend will argue."
smriti Posted February 10, 2005 Author Posted February 10, 2005 In that case, you could use a label control and set its text property to your desired text when the button is clicked, using the onclick event: Me.Label1.text = "Successful" 'Or something like this i have to display the message and redirect to another form after clicking the button. how will it be possible to display the text message i have to maintain some delay between displaying the message and redirecting to next form Quote
stustarz Posted February 10, 2005 Posted February 10, 2005 After populating the label use: 'Will pause for (i think) 1 second (could be 10), but either way set the value 'for the sleep to the time u want Thread.Sleep(1000) This simulates a delay then your code to redirect can be placed after Quote Visit: VBSourceSeek - The VB.NET sourcecode library "A mere friend will agree with you, but a real friend will argue."
twistedm1nd Posted February 10, 2005 Posted February 10, 2005 the time duration is in milliseconds therefore Thread.Sleep(1000) -- > sleeps for a second Quote
kahlua001 Posted February 10, 2005 Posted February 10, 2005 Interesting to see if this will work. Considering the label has been rendered to the page and the user is now disconnected from the webserver. You can do a wait page type of thing by overriding the response in the render sub. Or you can do this in javascript. Quote
smriti Posted February 11, 2005 Author Posted February 11, 2005 After populating the label use: 'Will pause for (i think) 1 second (could be 10), but either way set the value 'for the sleep to the time u want Thread.Sleep(1000) This simulates a delay then your code to redirect can be placed after No this is not working i gave 10 seconds sleep time , label is not displaying but its redirecting to next page Quote
kahlua001 Posted February 11, 2005 Posted February 11, 2005 Try what I mentioned. That will work. Quote
smriti Posted February 11, 2005 Author Posted February 11, 2005 Try what I mentioned. That will work. could u please explain me in somewhat detail or can u provide me any sample i am not able to get u r point Quote
smriti Posted February 11, 2005 Author Posted February 11, 2005 Dear all, i got it its very easy but i displayed the message in seperate aspx page. if u want the way then here it is http://www.developer.com/net/asp/article.php/1594521 Thanks Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.