Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 456
  • Last Modified:

display alert box then redirect

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
StewSupport
Asked:
StewSupport
1 Solution
 
bootrebootCommented:
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
 
StewSupportAuthor Commented:
yeah but this is a web page. you can't use msgbox
0
 
urir10Commented:
why not?
0
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 
tetorvikCommented:
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
 
StewSupportAuthor Commented:
the msgbox will work when you debugging it in vs studio but won't work when you host the site on your server.
0
 
StewSupportAuthor Commented:
i didnt have document.location in my code. thanks.
0

Featured Post

 [eBook] Windows Nano Server

Download this FREE eBook and learn all you need to get started with Windows Nano Server, including deployment options, remote management
and troubleshooting tips and tricks

Tackle projects and never again get stuck behind a technical roadblock.
Join Now