asp.net - how to send js library to client dynamically? -


i have string variable contains javascript codes.

i want send these codes client javascript file attached! like:

<script type="text/javascript" src="/lib/some.js"></script> 

but some.js file not exist on server!

how can in asp.net mvc3?

you can add string variable model ("myjavascriptcode"), output contents inside script tag on view. html.raw outputs content encoding it.

<script type="text/javascript">      @html.raw(model.myjavascriptcode) </script> 

Comments

Popular posts from this blog

Line ending issue with Mercurial or Visual Studio -

java - Jtable duplicate Rows -

java - Run a .jar on Heroku -