Click here to Skip to main content
15,568,616 members
Please Sign up or sign in to vote.
1.80/5 (2 votes)
I used the same code and it works in vs 2012 but not in vs2013. I wanted to go back to vs2012 but html5 not showing up properly in vs2012(css/js has been referenced).

Below is my master page


ASP.NET
<pre lang="xml"><title><%: Page.Title %> - Triocars</title>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<asp:PlaceHolder runat="server">
    <%: Scripts.Render("~/bundles/modernizr") %>
</asp:PlaceHolder>

<link href="~/favicon.ico" rel="shortcut icon" type="image/x-icon" />

<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">

<meta name="description" content="">
<meta name="author" content="">


<link rel="shortcut icon" href="~/favicon.ico">
<link rel="apple-touch-icon" href="~/apple-touch-icon.png">
<link href="Content/Site.css" rel="stylesheet" />
<link href="Theme/css/skel.css" rel="stylesheet" />
<link href="Theme/css/style.css" rel="stylesheet" />
<link href="Theme/css/style-noscript.css" rel="stylesheet" />

<link href="theme/css/font-awesome.min.css" rel="stylesheet" />

<script src="~/Scripts/libs/modernizr-1.7.min.js" type="text/javascript"></script>

<script src="Scripts/html5shiv.js"></script>

<script src="Theme/js/jquery.min.js"></script>
<script src="Theme/js/jquery.dropotron.min.js"></script>
<script src="Theme/js/skel.min.js"></script>
<script src="Theme/js/skel-layers.min.js"></script>
<script src="Theme/js/init.js"></script>


<asp:ContentPlaceHolder ID="HeadContent" runat="server">
</asp:ContentPlaceHolder>




ASP.NET
<pre lang="xml"><asp:ToolkitScriptManager ID="ToolkitScriptManager1" EnablePageMethods="true" runat="server">
    <Scripts>
        <%--To learn more about bundling scripts in ScriptManager see http://go.microsoft.com/fwlink/?LinkID=301884 --%>
        <%--Framework Scripts--%>

        <asp:ScriptReference Name="jquery" />
        <asp:ScriptReference Name="bootstrap" />
        <asp:ScriptReference Name="respond" />
        <asp:ScriptReference Name="WebForms.js" Path="~/Scripts/WebForms/WebForms.js" />

        <asp:ScriptReference Name="MenuStandards.js" Path="~/Scripts/WebForms/MenuStandards.js" />
        <asp:ScriptReference Name="GridView.js" Path="~/Scripts/WebForms/GridView.js" />
        <asp:ScriptReference Name="DetailsView.js" Path="~/Scripts/WebForms/DetailsView.js" />
        <asp:ScriptReference Name="TreeView.js" Path="~/Scripts/WebForms/TreeView.js" />
        <asp:ScriptReference Name="WebParts.js" Path="~/Scripts/WebForms/WebParts.js" />
        <asp:ScriptReference Name="Focus.js" Path="~/Scripts/WebForms/Focus.js" />
        <asp:ScriptReference Name="WebFormsBundle" />
        <%--Site Scripts--%>
    </Scripts>
</asp:ToolkitScriptManager>




Default Page:

XML
<!-- Banner -->
  <div class="container body-content" style="margin-left:0px;margin-right:0px;width:100%">
     <section id="banner" >

         <!--
             ".inner" is set up as an inline-block so it automatically expands
             in both directions to fit whatever's inside it. This means it won't
             automatically wrap lines, so be sure to use line breaks where
             appropriate (<br />).
         -->
         <div class="inner" >

             <header>
                 <h2>Book A Minicab</h2>
             </header>
             <div class="row">
                 <div class="6u">
             <p>

                     <asp:TextBox ID="TextBox1" Width="100%" runat="server"  style="text-align:center"></asp:TextBox>
                     <asp:AutoCompleteExtender ID="TextBox1_AutoCompleteExtender"
             runat="server" DelimiterCharacters=""
             Enabled="True" ServiceMethod="GetCompletionList"
             MinimumPrefixLength="1"
             CompletionSetCount="3"
                         TargetControlID="TextBox1" >
                     </asp:AutoCompleteExtender>
                     <br />

                 <asp:TextBox ID="TextBox2" Width="100%" runat="server" Placeholder="Via" style="text-align:center"></asp:TextBox><br />

                                         <asp:TextBox ID="TextBox3" Width="100%" runat="server" Placeholder="Date & Time" style="text-align:center"></asp:TextBox>


             </p></div>
                 <div class="6u">

                                         <p>



                     <asp:TextBox ID="TextBox4"  Width="100%" runat="server" Placeholder="Destination Address" style="text-align:center"></asp:TextBox><br />

                 <asp:TextBox ID="TextBox5" Width="100%" runat="server" Placeholder="Vehicle" style="text-align:center"></asp:TextBox><br />

                                         <asp:TextBox ID="TextBox6" Width="100%" runat="server" Placeholder="Phone Number" style="text-align:center"></asp:TextBox>


             </p>
                 </div>
                 </div>
             <footer>
                 <ul class="buttons vertical" >
                     <li><a href="#main" class="button fit scrolly" >Book Now</a> </li>
                 </ul>
             </footer>

         </div>

     </section>


      </div>



Default page code behind:

C#
namespace trio_web
{
public partial class _Default : Page
{
    protected void Page_Load(object sender, EventArgs e)
    {

    }

    [System.Web.Services.WebMethodAttribute(), System.Web.Script.Services.ScriptMethodAttribute()]
    public static string[] GetCompletionList(string prefixText, int count)
    {
        // Create array of movies
        string[] movies = { "Star Wars", "Star Trek", "Superman", "Memento", "Shrek", "Shrek II" };

        // Return matching movies
        return (from m in movies where m.StartsWith(prefixText, StringComparison.CurrentCultureIgnoreCase) select m).Take(count).ToArray();
    }


}
}



It throws an exception, 0x800a139e - JavaScript runtime error: Sys.ArgumentException: Cannot deserialize. The data does not correspond to valid JSON. If I create the project in vs2013 and open in vs2012 the result is same. Is it something to do with jquery version?

Output Window

Exception was thrown at line 647, column 3 in eval code
0x800a1391 - JavaScript runtime error: 'r' is undefined
Exception was thrown at line 4271, column 10 in http://localhost:51142/ScriptResource.axd?d=yeSNAJTOPtPimTGCAo3LlU3wH2kOYuAUbp-5q3LuaD4nJMrF0SS33e26gOqzl07HhDrDM2bw0azVrQc6hyOoWF0zsZLeMiVZzW95Wjc5SdnhfGjV-C_jRm9dyzOPKjMI0&t=ffffffffda74082d
0x800a139e - JavaScript runtime error: Sys.ArgumentException: Cannot deserialize. The data does not correspond to valid JSON.
Parameter name: data
Exception was thrown at line 613, column 3 in eval code
0x800a1391 - JavaScript runtime error: 'D' is undefined
Exception was thrown at line 4271, column 10 in http://localhost:51142/ScriptResource.axd?d=yeSNAJTOPtPimTGCAo3LlU3wH2kOYuAUbp-5q3LuaD4nJMrF0SS33e26gOqzl07HhDrDM2bw0azVrQc6hyOoWF0zsZLeMiVZzW95Wjc5SdnhfGjV-C_jRm9dyzOPKjMI0&t=ffffffffda74082d
0x800a139e - JavaScript runtime error: Sys.ArgumentException: Cannot deserialize. The data does not correspond to valid JSON.
Parameter name: data
Exception was thrown at line 715, column 3 in eval code
0x800a1391 - JavaScript runtime error: 'M' is undefined
Exception was thrown at line 4271, column 10 in http://localhost:51142/ScriptResource.axd?d=yeSNAJTOPtPimTGCAo3LlU3wH2kOYuAUbp-5q3LuaD4nJMrF0SS33e26gOqzl07HhDrDM2bw0azVrQc6hyOoWF0zsZLeMiVZzW95Wjc5SdnhfGjV-C_jRm9dyzOPKjMI0&t=ffffffffda74082d
0x800a139e - JavaScript runtime error: Sys.ArgumentException: Cannot deserialize. The data does not correspond to valid JSON.
Parameter name: data
Exception was thrown at line 697, column 3 in eval code
0x800a1391 - JavaScript runtime error: 'b' is undefined
Exception was thrown at line 4271, column 10 in http://localhost:51142/ScriptResource.axd?d=yeSNAJTOPtPimTGCAo3LlU3wH2kOYuAUbp-5q3LuaD4nJMrF0SS33e26gOqzl07HhDrDM2bw0azVrQc6hyOoWF0zsZLeMiVZzW95Wjc5SdnhfGjV-C_jRm9dyzOPKjMI0&t=ffffffffda74082d
0x800a139e - JavaScript runtime error: Sys.ArgumentException: Cannot deserialize. The data does not correspond to valid JSON.
Parameter name: data
Exception was thrown at line 661, column 3 in eval code
0x800a1391 - JavaScript runtime error: 'w' is undefined
Exception was thrown at line 4271, column 10 in http://localhost:51142/ScriptResource.axd?d=yeSNAJTOPtPimTGCAo3LlU3wH2kOYuAUbp-5q3LuaD4nJMrF0SS33e26gOqzl07HhDrDM2bw0azVrQc6hyOoWF0zsZLeMiVZzW95Wjc5SdnhfGjV-C_jRm9dyzOPKjMI0&t=ffffffffda74082d
0x800a139e - JavaScript runtime error: Sys.ArgumentException: Cannot deserialize. The data does not correspond to valid JSON.
Parameter name: data

Any help will be much appreciated.

Thanks, Anup
Posted
Updated 23-Apr-14 11:41am
v4

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900