Solved

display alert box then redirect

Posted on 2009-05-12
6
439 Views
Last Modified: 2012-05-06
i have a

ClientScript.RegisterStartupScript(Me.GetType(), "AlertBox", "alert('Your request is completed.');", True)
resposne.redirect("")


i want the user to click ok in this box then redirect. but my page right now doesn't even stop for this to happen and just go straight to the redirect page. so how do i stop the page so that it allows users to click ok before it goes to redirect.
0
Comment
Question by:StewSupport
6 Comments
 
LVL 2

Expert Comment

by:bootreboot
ID: 24368371
In VB.net the way to do it is

If MsgBox("message", MsgBoxStyle.OKOnly, "Title") = MsgBoxResult.OK Then
     resposne.redirect("")
End If

Open in new window

0
 

Author Comment

by:StewSupport
ID: 24368389
yeah but this is a web page. you can't use msgbox
0
 
LVL 7

Expert Comment

by:urir10
ID: 24368432
why not?
0
Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

 
LVL 9

Accepted Solution

by:
tetorvik earned 500 total points
ID: 24368434
you can do it with javascript:

 ClientScript.RegisterStartupScript(Me.GetType(), "AlertBox", "alert('Your request is completed.');document.location='NewPage.aspx';", True)

Open in new window

0
 

Author Comment

by:StewSupport
ID: 24368482
the msgbox will work when you debugging it in vs studio but won't work when you host the site on your server.
0
 

Author Closing Comment

by:StewSupport
ID: 31580691
i didnt have document.location in my code. thanks.
0

Featured Post

Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Just a quick little trick I learned recently.  Now that I'm using jQuery with abandon in my asp.net applications, I have grown tired of the following syntax:      (CODE) I suppose it just offends my sense of decency to put inline VBScript on a…
More often than not, we developers are confronted with a need: a need to make some kind of magic happen via code. Whether it is for a client, for the boss, or for our own personal projects, the need must be satisfied. Most of the time, the Framework…
This video shows how to quickly and easily add an email signature for all users on Exchange 2016. The resulting signature is applied on a server level by Exchange Online. The email signature template has been downloaded from: www.mail-signatures…
Email security requires an ever evolving service that stays up to date with counter-evolving threats. The Email Laundry perform Research and Development to ensure their email security service evolves faster than cyber criminals. We apply our Threat…

772 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question