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 Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Passing Values from ASP to Javascript

Status
Not open for further replies.

jfrost10

Programmer
Jun 3, 2001
2,004
CA
Hey guys,

I have an asp.net page, which also has an asp.net listbox and an html button. When the html button is pressed, I need the selected item text to be passed to a javascript function which then opens a new window.

Question: How can I pass a value from an asp control to a javascript function? I know this is an old-school asp forum, but I figured you guys might have more experience with this sort of thing than us code-behind boys would.
;)

Thanks guys,

Jack
 
Not familiar with .Net stuff yet, but I would think it would be the same or similar...


<%
Dim msg
msg = &quot;This is a test message!&quot;
%>
<html>
<head>
<script language='javascript'>
<!--
function tellMe(){
alert(&quot;<%= msg%>&quot;);
}
// -->
</script>
</head>
<body onLoad=&quot;tellMe()&quot;>

</body>
</html>

-Ovatvvon :-Q
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top