Hi,
You can mix and match languages via a user control.
Put your jscript in a user control such as jscriptest.ascx as shown below:
<%@ control classname="jscriptest" language="jscript" %>
<script runat="server">
function monthNum(value : Date) : int {
return value.getMonth() + 1;
}
function datetoString(value : Date) : String {
return monthNum(value)+ "/" +
value.getDate() + "/" +
value.getYear();
}
var dt = new Date();
</script>
<%
Response.Write("The month is " + monthNum(dt) +".<BR>\n");
Response.Write("Date is " + datetoString(dt) +".<BR>\n");
%>
Create a VB jscriptuse.aspx page and drop the user control onto it, as shown
below:
<%@ Page Language="VB" %>
<%@ register src="jscriptest.ascx" tagname="jscriptest" tagprefix="uc1" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"
http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="
http://www.w3.org/1999/xhtml" >
<head runat="server">
<title>JScript</title>
</head>
<body>
<form id="form1" runat="server">
<div>
<uc1:jscriptest id="Jscriptest1" runat="server" />
</div>
</form>
</body>
</html>
When you run the ASP.NET page, you get the content from the user control.
Perhaps this will give you the idea to expand on.
See more here:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnclinic/html/scripting01222002.asp
Let us know how you make out?
Ken
Microsoft MVP [ASP.NET]