As someone who is brand new to ASP.NET, I am facing a challenge with a JavaScript file where I want to input values dynamically upon page load. In my attempt to test this feature, I used the following code:
$
(
function ()
{
alert('<% = DateTime.Now.ToString("dddd, MMMM d, yyyy") %>');
}
)
The alert successfully triggers upon page load as expected, but the VB script does not execute; instead, the VB code gets echoed back as if it were simply treated as another string.
This script file is declared on the site master page right before the closing body tag.
I'm not sure what mistake I might be making here. Any help would be greatly appreciated. Thank you.