You must Sign In to post a response.
  • Category: ASP.Net MVC

    Jquery file not firing quickly in MVC

    Hi,

    Iam new to MVC. following is a working code

    @model System.Data.DataTable
    @using System.Data;

    <h2>Report</h2>
    <html>
    <head>
    <title>SQLQueryExample</title>
    <script language="javascript" type="text/javascript" src="../../Scripts/jquery-1.7.1.js"></script>
    <style type="text/css">
    table,th,td{border:1px solid black;border-collapse:collapse;}
    td{padding:0;text-align:center;}

    </style>

    </head>
    <body>

    <table id="GridView3">
    <thead>
    <tr>
    @foreach (DataColumn col in Model.Columns)
    {
    <th >@col.ColumnName</th>
    }
    </tr>
    </thead>
    <tbody>
    @foreach (DataRow row in Model.Rows)
    {
    <tr>
    @foreach (DataColumn col in Model.Columns)
    {
    <td>@row[col.ColumnName]</td>

    }

    </tr>

    }

    </tbody>

    </table>
    <script language="javascript" type="text/javascript" src="../../Scripts/bus.js"></script>
    </body>

    </html>

    problem is jquery file is not firing quickly. it takes some seconds.

    so where to add jquery file properly

    Regards

    Baiju
  • #766813
    Hi,

    Usually we put all the references and Client side scripts in header section that means before the design part, as I seen your code you did the same, but still your page gets slow, I guess the problem might be different not because of this.

    --------------------------------------------------------------------------------
    Give respect to your work, Instead of trying to impress your boss.

    N@veen
    Blog : http://naveens-dotnet.blogspot.in/

  • #766844
    why are you using JQuery ? for validation ? do you have call it on page_load ?

    one way is, You can use these page level helpers
    see below snippet

    Html.EnableClientValidation(false);
    Html.EnableUnobtrusiveJavaScript(false);

    There are many factors affecting, Please elaborate more for it

    Thanks
    Koolprasd2003
    Editor, DotNetSpider MVM
    Microsoft MVP 2014 [ASP.NET/IIS]


  • Sign In to post your comments