I am trying to get inline c# to work in my javascript files using the MVC Framework. I made this little test code up.
$(document).ready(function() {
alert(<%= ViewData["Message"] %>);
});
When this code is used inside of the view it works perfectly. When I get outside of my aspx view and try this in a javascript file I get illegal XML character. I figure this is by design in the MVC Framework but I haven't been able to find any material on this on the web. Has anyone gotten inline C# to work in javascript files using the MVC Framework?