Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Where to declare JavaScript ? 2

Status
Not open for further replies.

ASPVB

Programmer
Jul 27, 2002
32
US
Hi there!
Does somebody can advise me ?
Well I want to send to client message (by: <script ...>alert(....);</script>)
I tryed to do next steps :
1)Response.Write(&quot;<script language=javascript>alert('blah .. blah');</script>&quot;)
2)If Not Page.IsClientScriptBlockRegistered(&quot;doPopup&quot;) Then _
Page.RegisterClientScriptBlock(&quot;domessag&quot;, (&quot;<script language=javascript>alert('blah .. blah');</script>&quot;)

Doesn't matter where I'll put these lines it is execute on Page_Load event before HTML contein written to browser!

Is there the way to declare/... scripts so it will appear after HTML Page generated ?
 
What event should triiger the alert?
 
Hi LV !
Glad to hear you!
Thanks for helping me before ,now it is work easy becouse it is full version of .NET !
All right : I want confurm client-side after successful exion action delete/update db . Like I did in VID

Thanks.
 
You can try this:
Code:
dim myScript as string = &quot;<script language='javascript'>&quot;
myScript = myScript & &quot;function window.onload(){&quot;
myScript = myScript & &quot;alert('Update success');}&quot;
myScript = myScript & &quot;</script>&quot;
If Not Page.IsClientScriptBlockRegistered(&quot;doPopup&quot;) Then
 Page.RegisterClientScriptBlock(&quot;doPopup&quot;, myScript)
End If
Since the onload event fires after HTML is rendered into the browser, your alert should show after it.
 
You are genius , men !
Why yuo are & where are you live ? May be it will be easy to meet with you & take couple private lessons - I'll have a lot question ?
Thanks , it work !
 
Gals it worked and thanks for the star. As for the lessons... I realy have a lot to learn myself before teaching someone, realy. There is a lot of people on this forum who knows more than I do. Just post your questions here and I'm sure they'll be answered.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top