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

java - Run a .jar on Heroku -

java - Jtable duplicate Rows -

validation - How to pass paramaters like unix into windows batch file -