I have recently become a T4MVC fanatic and now I seem incapable of using visual strings in my MVC3 projects. I am currently trying to use an T4MVC link to a script file inside a JavaScript function but it appears that I'm either doing it wrong or it's not possible. The code follows. Any help would be appreciated.
<script type="text/javascript">
$(function () {
if (!Modernizr.inputtypes.range) 开发者_开发技巧{
$.getScript(@Links.Scripts.modernizr_1_7_min_js, function(){
$("input[type='range']").range();
});
}
});
</script>
EDIT:
Sorry, there is no issue with T4MVC in JavaScript. Looking at the page source, the link text is generated properly.
Sorry. This ended up being a non-issue. There is no issue with using T4MVC in Javascript. I guess I was thrown off because VS does not provide intellisence for T4MVC while editing JS. Thanks for following up David.
精彩评论