|
-
Nov 3rd, 2004, 01:01 PM
#3
Hyperactive Member
The most accepted way to do this is as follows:-
if <your data code> then
dim sb as new system.text.stringbuilder
sb.append("<script language=""javascript"">" & vbcrlf)
sb.append("Function (TermID)" & vbcrlf)
sb.append("var TermID = prompt(""Enter Terminal ID for " & Session("st") & """);" & vbcrlf)
sb.append("</script>")
page.registerstartupscript("myscript", sb.tostring)
sb = nothing
end if
What this does is correctly places the javascript where it is sure to run once the page has loaded (and all objects are loaded and rendered on the page). It also allows you to access the code and remove it by using the name you give it, myscript, in the case above. The vbcrlf is just to make the code readable in the pages source.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|