title: jQuery function is not working in my MVC Application
body: <p>In my <code>MVC</code> application <code>onclick</code> function is not working. </p>
  
  <pre><code>@section Scripts{
      &lt;script src="~/Scripts/plugins/toastr/toastr.min.js"&gt;&lt;/script&gt;
      &lt;script&gt;
          $(document).ready(function () {
  
              var page = 0;
              var type = "Category";
  
              function Count(param) {
                  if (param === 1) {
                      page++;
                  }
                  else if (param === -1) {
                      if (count === 0) {
                          return;
                      }
                      page--;
                  }
  
              }
  
              function Search() {
                  var query = $("#searchquery").val();
  
              }
  
              function ListResult(param) {
  
                  if (param === "Category") {
                      type = param;
                      page = 0;
                      $(".category_type").css({ "color": "green" });
                  } else if (param === "Product") {
                      type = param;
                      page = 0;
                      $(".product_type").css({ "color": "green" });
                  }
  
              }
          });
      &lt;/script&gt;
  }
  </code></pre>
  
  <p>In the Code above, there is a <code>script</code> tag of my code, and code below is the html part. I don't understand why it is not working . 
  I wrote alert to test if  tag is working. It is working but problem is  <code>function is not defined</code></p>
  
  <pre><code> &lt;a class="btn btn-lg btn-primary" type="button" onclick="Search()"&gt;
                              @Resources.Resource.btn_Search
                          &lt;/a&gt; 
   &lt;a class="btn btn-white btn-sm" onclick="Count(1)"&gt;&lt;i class="fa fa-arrow-left"&gt;&lt;/i&gt;&lt;/a&gt;
                  &lt;a class="btn btn-white btn-sm" onclick="Count(-1)"&gt;&lt;i class="fa fa-arrow-right"&gt;&lt;/i&gt;&lt;/a&gt;
  
    &lt;li&gt;&lt;a href="#" onclick="ListResult('Category')" class="category_type type"style="color: green"&gt;&lt;i class="fa fa-folder category_type type"style="color: green"&gt;&lt;/i&gt; @Resources.Resource.Categories&lt;/a&gt;&lt;/li&gt;
                              &lt;li&gt;&lt;a href="#" onclick="ListResult('Product')"class="product_type type"&gt;&lt;i class="fa fa-folder product_type type"&gt;&lt;/i&gt; @Resources.Resource.Products&lt;/a&gt;&lt;/li&gt;
  </code></pre>
  
  
  
  <blockquote>
    <p>DaysOffer:193 Uncaught ReferenceError: Search is not defined
        at HTMLAnchorElement.onclick (DaysOffer:193)</p>
  </blockquote>
  
  <p>How can I resolve it. </p>
  
  <p>Thanks in advance.</p>