Re: Alert box doesn't appear
- From: "Jan" <ertgsd@xxxxxx>
- Date: Thu, 8 Mar 2007 19:06:08 +0100
Ok thanks for explantion
"Damien" <Damien_The_Unbeliever@xxxxxxxxxxx> schreef in bericht
news:1173340294.287106.279490@xxxxxxxxxxxxxxxxxxxxxxxxxxxxx
On Mar 7, 8:42 pm, "Jan" <cbcbc@xcvx> wrote:
Hi,
Why don't i see the Alert box? The page is redirected without showing it.
I
also tried with parameter 'False' and 'True'.
Protected Sub Page_Load(ByVal sender As Object, ByVal e As
System.EventArgs)
Handles Me.Load
Dim a As Integer
a = 5
If a = 5 Then
Dim jv As String
jv = "<script language='javascript'>" _
& " alert(this is ok);" _
& "</script>"
Response.Write(jv)
Response.Redirect(next.aspx")
'Response.Redirect(next.aspx", False)
'Response.Redirect(next.aspx", True)
End If
End Sub
Thanks
Jan
Okay,
When you send a normal GET/POST request to a server, it generates a
response which consists of headers and content. Part of the headers
for a normal response it a status code - 200. This tells the browser
that the response is normal, and that it should go ahead and use the
rest of the headers and the content to display the page to the user.
When you use Response.Redirect on the server, it changes that status
code that is sent back to the client to 302. This status code,
essentially, says "what you were asking for has temporarily moved to
this new location", and provides the location information (in this
case, next.aspx). The browser just goes right ahead and requests the
next page - it never receives/processes and content associated with
the old page.
If you want to have a message box and then navigate to the next page,
you can put the navigation step into the javascript. Just add
window.navigate('next.aspx') to your script.
Damien
.
- References:
- Alert box doesn't appear
- From: Jan
- Re: Alert box doesn't appear
- From: Damien
- Alert box doesn't appear
- Prev by Date: Re: How can I stop my Calendar control from firing the form validation events?
- Next by Date: precedence between OnClientClick and OnClick?
- Previous by thread: Re: Alert box doesn't appear
- Next by thread: DropDownList box ~ Update Concatenated fields ~Help Please???
- Index(es):
Relevant Pages
|