I am using JQuery UI Dialog function to load a partial view. The Dialog form contains input controls that holds data to saved in database. I am trying to get the values from the controls to post them as below:
<script type="text/javascript">
function SaveItem() {
var name = $("#Name").val();
var price = $("#Price").val();
}
</script>
When clicking create button that triggers the SaveItem Function: it gives this error:
Create:35 Uncaught ReferenceError: $ is not defined
I am already rendering the jquery libraries in _Layout.cshtml. I know that this partial view will not have those libraries since its loaded out side the main container.
So, how we can do that, what is the best practice? Is there a way other than including the jquery library again in the partial view?