微软JScript运行时错误:对象不支持属性或方法“活”? [英] Microsoft JScript runtime error: Object doesn't support property or method 'live'?

查看:129
本文介绍了微软JScript运行时错误:对象不支持属性或方法“活”?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我点击按钮,显示下面的错误Microsoft JScript运行错误:对象不支持属性或方法'活'
    我查看页面如下:

  @model Charis.Models.Products
@ {
    ViewBag.Title =创建;
    布局=〜/查看/共享/ _Layout.cshtml
}
<链接HREF =../../内容/ CharisSite.css的rel =stylesheet属性类型=文/ CSS/>
<脚本类型=文/ JavaScript的SRC =HTTP://$c$c.jquery.com/jquery-latest.js>< / SCRIPT>
@using(Html.BeginForm(创建,正式版,FormMethod.Post,新{ENCTYPE =的multipart / form-data的}))
{
    @ Html.ValidationSummary(真)
    <表>< TR>< TD>
    <表>
    &所述; TR>
    &所述; TD>
     <&字段集GT;
             <传奇>产品< /传说>     <表>
        &所述; TR>
        &所述; TD>
            < D​​IV CLASS =编辑标记>
            @ Html.LabelFor(型号=> model.Productname)
            < / DIV>
        < / TD>
        &所述; TD>
             < D​​IV CLASS =主编场>
            @ Html.EditorFor(型号=> model.Productname)
            @ Html.ValidationMessageFor(型号=> model.Productname)
            < / DIV>
        < / TD>
        < / TR>
        &所述; TR>
        &所述; TD>
            < D​​IV CLASS =编辑标记>
                @ Html.LabelFor(型号=> model.ProductPrice)
            < / DIV>
        < / TD>
        &所述; TD>
            < D​​IV CLASS =主编场>
            @ Html.EditorFor(型号=> model.ProductPrice)
            @ Html.ValidationMessageFor(型号=> model.ProductPrice)
            < / DIV>
        < / TD>
        < / TR>
        &所述; TR>
        &所述; TD>
            < D​​IV CLASS =编辑标记>
            @ Html.LabelFor(型号=> model.ProductDiscount)
            < / DIV>
        < / TD>
        &所述; TD>
            < D​​IV CLASS =主编场>
            @ Html.EditorFor(型号=> model.ProductDiscount)
            @ Html.ValidationMessageFor(型号=> model.ProductDiscount)
            < / DIV>
        < / TD>
        < / TR>        &所述; TR>
        &所述; TD>
            < D​​IV CLASS =编辑标记>
                @ Html.LabelFor(型号=> model.LanguageType)
            < / DIV>
        < / TD>
        &所述; TD>
             < D​​IV CLASS =主编场>
            @ Html.EditorFor(型号=> model.LanguageType)
            @ Html.ValidationMessageFor(型号=> model.LanguageType)
            < / DIV>
        < / TD>
        < / TR>        &所述; TR>
        &所述; TD>
             < D​​IV CLASS =编辑标记>
                @ Html.LabelFor(型号=> model.ReleaseDate)
            < / DIV>
        < / TD>
        &所述; TD>
                < D​​IV CLASS =主编场>
                         @ Html.EditorFor(型号=> model.ReleaseDate)
                         @ Html.ValidationMessageFor(型号=> model.ReleaseDate)
                < / DIV>
        < / TD>
        < / TR>
        &所述; TR>
        &所述; TD>
             < D​​IV CLASS =编辑标记>               <标签=文件>上传图片:< /标签>
            < / DIV>
        < / TD>
        &所述; TD>
                < D​​IV CLASS =主编场>
                    <输入类型=文件名称=文件ID =文件/>
               < / DIV>
        < / TD>
        < / TR>     < /表>    < /字段集>
    < / TD>
    &所述; TD>&下; / TD>&下; / TR>
    < /表>    < / TD>< / TR>
    &所述; TR>&下; TD>    <表>
    &所述; TR>
    &所述; TD>
        <&字段集GT;
        <传奇>详情< /传说>
            <表>
                &所述; TR>
                    &所述; TD>
                        < D​​IV CLASS =编辑标记>
                            @ Html.LabelFor(型号=> model.AlbumDescription1)
                        < / DIV>
                    < / TD>
                    &所述; TD>
                        < D​​IV CLASS =主编场>
                            @ Html.EditorFor(型号=> model.AlbumDescription1)
                            @ Html.ValidationMessageFor(型号=> model.AlbumDescription1)
                        < / DIV>
                    < / TD>
                < / TR>
                &所述; TR>
                    &所述; TD>
                        < D​​IV CLASS =编辑标记>
                            @ Html.LabelFor(型号=> model.AlbumDescription2)
                        < / DIV>
                    < / TD>
                    &所述; TD>
                        < D​​IV CLASS =主编场>
                            @ Html.EditorFor(型号=> model.AlbumDescription2)
                            @ Html.ValidationMessageFor(型号=> model.AlbumDescription2)
                        < / DIV>
                    < / TD>
                < / TR>
                &所述; TR>
                    &所述; TD>
                        < D​​IV CLASS =编辑标记>
                            @ Html.LabelFor(型号=> model.Cast)
                        < / DIV>
                    < / TD>
                    &所述; TD>
                        < D​​IV CLASS =主编场>
                            @ Html.EditorFor(型号=> model.Cast)
                            @ Html.ValidationMessageFor(型号=> model.Cast)
                        < / DIV>
                    < / TD>
                < / TR>
                &所述; TR>
                    &所述; TD>
                        < D​​IV CLASS =编辑标记>
                            @ Html.LabelFor(型号=> model.DirectedBy)
                        < / DIV>
                    < / TD>
                    &所述; TD>
                        < D​​IV CLASS =主编场>
                            @ Html.EditorFor(型号=> model.DirectedBy)
                            @ Html.ValidationMessageFor(型号=> model.DirectedBy)
                        < / DIV>
                    < / TD>
                < / TR>
                &所述; TR>
                    &所述; TD>
                        < D​​IV CLASS =编辑标记>
                            @ Html.LabelFor(型号=> model.ProducedBy)
                        < / DIV>
                    < / TD>
                    &所述; TD>
                        < D​​IV CLASS =主编场>
                            @ Html.EditorFor(型号=> model.ProducedBy)
                            @ Html.ValidationMessageFor(型号=> model.ProducedBy)
                        < / DIV>
                    < / TD>
                < / TR>                &所述; TR>
                    &所述; TD>
                        < D​​IV CLASS =编辑标记>
                           <标签=文件> Image1的上传:LT; /标签>
                        < / DIV>
                    < / TD>
                    &所述; TD>
                        < D​​IV CLASS =主编场>
                            <输入类型=文件名称=文件1ID =文件1/>
                        < / DIV>
                    < / TD>
                < / TR>                &所述; TR>
                    &所述; TD>
                        < D​​IV CLASS =编辑标记>
                           <标签=文件>上传IMAGE2:LT; /标签>
                        < / DIV>
                    < / TD>
                    &所述; TD>
                        < D​​IV CLASS =主编场>
                            <输入类型=文件名称=文件2ID =文件2/>
                        < / DIV>
                    < / TD>
                < / TR>                &所述; TR>
                    &所述; TD>
                        < D​​IV CLASS =编辑标记>
                           <标签=文件>上传图像3:LT; /标签>
                        < / DIV>
                    < / TD>
                    &所述; TD>
                        < D​​IV CLASS =主编场>
                            <输入类型=文件名称=文件3ID =文件3/>
                        < / DIV>
                    < / TD>
                < / TR>                &所述; TR>
                    &所述; TD>
                        < D​​IV CLASS =编辑标记>
                           <标签=文件>上传图片4:LT; /标签>
                        < / DIV>
                    < / TD>
                    &所述; TD>
                        < D​​IV CLASS =主编场>
                            <输入类型=文件名称=file4将ID =file4将/>
                        < / DIV>
                    < / TD>
                < / TR>                &所述; TR>
                    &所述; TD>
                        < D​​IV CLASS =编辑标记>
                           <标签=文件>上传图像5:LT; /标签>
                        < / DIV>
                    < / TD>
                    &所述; TD>
                        < D​​IV CLASS =主编场>
                            <输入类型=文件名称=file5ID =file5/>
                        < / DIV>
                    < / TD>
                < / TR>                &所述; TR>
                    &所述; TD>
                        < D​​IV CLASS =编辑标记>
                            @ Html.LabelFor(型号=> model.NoOfDisk)
                        < / DIV>
                    < / TD>
                    &所述; TD>
                        < D​​IV CLASS =主编场>
                            @ Html.EditorFor(型号=> model.NoOfDisk)
                            @ Html.ValidationMessageFor(型号=> model.NoOfDisk)
                        < / DIV>
                    < / TD>
                < / TR>                &所述; TR>
                    &所述; TD>
                        < D​​IV CLASS =编辑标记>
                            @ Html.LabelFor(型号=> model.Weight)
                        < / DIV>
                    < / TD>
                    &所述; TD>
                        < D​​IV CLASS =主编场>
                            @ Html.EditorFor(型号=> model.Weight)
                            @ Html.ValidationMessageFor(型号=> model.Weight)
                        < / DIV>
                    < / TD>
                < / TR>                &所述; TR>
                    &所述; TD>
                        < D​​IV CLASS =编辑标记>
                            @ Html.LabelFor(型号=> model.Format)
                        < / DIV>
                    < / TD>
                    &所述; TD>
                        < D​​IV CLASS =主编场>
                            @ Html.EditorFor(型号=> model.Format)
                            @ Html.ValidationMessageFor(型号=> model.Format)
                        < / DIV>
                    < / TD>
                < / TR>            < /表>
        < /字段集>
    < / TD>
    < / TR>
    < /表>    < / TD>< / TR>    &所述; TR>&下; TD>
        <表>< TR>< TD><&字段集GT;<表>
            &所述; TR>
                &所述; TD>
                &所述p为H.;
                    <输入类型=提交值=创建/>
                    <输入类型=按钮值=清除ID =btnClear/>
                &所述; / P>
                < / TD>
            < / TR>
        < /表>< /字段集>< / TD>< / TR>< /表>    < / TD>< / TR>    < /表>}@ *< D​​IV>
    @ Html.ActionLink(返回目录,索引)
< / DIV>
* @
@section脚本{
    @ Scripts.Render(〜/包/ jqueryval)
}@if(TempData的[通知]!= NULL)
{
< p =风格颜色:红色; > @TempData [通知] LT; / P>
}


解决方案

正在使用jQuery最新版本(1.9 ...),其中 $(SEL).live(...)是德$ p $因此pcated您的错误信息。

1),恢复到一个旧版本的jQuery。

2)更新code(通过更换现场)。

3)放回jQuery的,最新的。

I am clicking on button the following error is shown "Microsoft JScript runtime error: Object doesn't support property or method 'live'" My View page is as follows:

@model Charis.Models.Products
@{
    ViewBag.Title = "Create";
    Layout = "~/Views/Shared/_Layout.cshtml";
}
<link href="../../Content/CharisSite.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="http://code.jquery.com/jquery-latest.js"></script>
@using (Html.BeginForm("Create", "Prod", FormMethod.Post, new { enctype = "multipart/form-data" }))
{
    @Html.ValidationSummary(true)
    <table><tr><td>
    <table>
    <tr>
    <td>
     <fieldset>
             <legend>Products</legend>

     <table>
        <tr>
        <td>
            <div class="editor-label">
            @Html.LabelFor(model => model.Productname)
            </div>
        </td>
        <td>
             <div class="editor-field">
            @Html.EditorFor(model => model.Productname)
            @Html.ValidationMessageFor(model => model.Productname)
            </div>
        </td>
        </tr>
        <tr>
        <td>
            <div class="editor-label">
                @Html.LabelFor(model => model.ProductPrice)
            </div>
        </td>
        <td>
            <div class="editor-field">
            @Html.EditorFor(model => model.ProductPrice)
            @Html.ValidationMessageFor(model => model.ProductPrice)
            </div>
        </td>
        </tr>
        <tr>
        <td>
            <div class="editor-label">
            @Html.LabelFor(model => model.ProductDiscount)
            </div>
        </td>
        <td>
            <div class="editor-field">
            @Html.EditorFor(model => model.ProductDiscount)
            @Html.ValidationMessageFor(model => model.ProductDiscount)
            </div>
        </td>
        </tr>

        <tr>
        <td>
            <div class="editor-label">
                @Html.LabelFor(model => model.LanguageType)
            </div>
        </td>
        <td>
             <div class="editor-field">
            @Html.EditorFor(model => model.LanguageType)
            @Html.ValidationMessageFor(model => model.LanguageType)
            </div>
        </td>
        </tr>

        <tr>
        <td>
             <div class="editor-label">
                @Html.LabelFor(model => model.ReleaseDate)
            </div>
        </td>
        <td>
                <div class="editor-field">
                         @Html.EditorFor(model => model.ReleaseDate)
                         @Html.ValidationMessageFor(model => model.ReleaseDate)
                </div>
        </td>
        </tr>
        <tr>
        <td>
             <div class="editor-label">

               <label for="file">Upload Image:</label>
            </div>
        </td>
        <td>
                <div class="editor-field">
                    <input type="file" name="file" id="file"/>
               </div>
        </td>
        </tr>

     </table> 

    </fieldset>
    </td>
    <td></td></tr>
    </table>

    </td></tr>
    <tr><td>



    <table>
    <tr>
    <td>
        <fieldset>
        <legend>Details</legend>
            <table>
                <tr>
                    <td>
                        <div class="editor-label">
                            @Html.LabelFor(model => model.AlbumDescription1)
                        </div>
                    </td>
                    <td>
                        <div class="editor-field">
                            @Html.EditorFor(model => model.AlbumDescription1)
                            @Html.ValidationMessageFor(model => model.AlbumDescription1)
                        </div>
                    </td>
                </tr>
                <tr>
                    <td>
                        <div class="editor-label">
                            @Html.LabelFor(model => model.AlbumDescription2)
                        </div>
                    </td>
                    <td>
                        <div class="editor-field">
                            @Html.EditorFor(model => model.AlbumDescription2)
                            @Html.ValidationMessageFor(model => model.AlbumDescription2)
                        </div>
                    </td>
                </tr>
                <tr>
                    <td>
                        <div class="editor-label">
                            @Html.LabelFor(model => model.Cast)
                        </div>
                    </td>
                    <td>
                        <div class="editor-field">
                            @Html.EditorFor(model => model.Cast)
                            @Html.ValidationMessageFor(model => model.Cast)
                        </div>
                    </td>
                </tr>
                <tr>
                    <td>
                        <div class="editor-label">
                            @Html.LabelFor(model => model.DirectedBy)
                        </div>
                    </td>
                    <td>
                        <div class="editor-field">
                            @Html.EditorFor(model => model.DirectedBy)
                            @Html.ValidationMessageFor(model => model.DirectedBy)
                        </div>
                    </td>
                </tr>
                <tr>
                    <td>
                        <div class="editor-label">
                            @Html.LabelFor(model => model.ProducedBy)
                        </div>
                    </td>
                    <td>
                        <div class="editor-field">
                            @Html.EditorFor(model => model.ProducedBy)
                            @Html.ValidationMessageFor(model => model.ProducedBy)
                        </div>
                    </td>
                </tr>

                <tr>
                    <td>
                        <div class="editor-label">
                           <label for="file">Upload Image1:</label>
                        </div>
                    </td>
                    <td>
                        <div class="editor-field">
                            <input type="file" name="file1" id="file1"/>
                        </div>
                    </td>
                </tr>

                <tr>
                    <td>
                        <div class="editor-label">
                           <label for="file">Upload Image2:</label>
                        </div>
                    </td>
                    <td>
                        <div class="editor-field">
                            <input type="file" name="file2" id="file2"/>
                        </div>
                    </td>
                </tr>

                <tr>
                    <td>
                        <div class="editor-label">
                           <label for="file">Upload Image3:</label>
                        </div>
                    </td>
                    <td>
                        <div class="editor-field">
                            <input type="file" name="file3" id="file3"/>
                        </div>
                    </td>
                </tr>

                <tr>
                    <td>
                        <div class="editor-label">
                           <label for="file">Upload Image4:</label>
                        </div>
                    </td>
                    <td>
                        <div class="editor-field">
                            <input type="file" name="file4" id="file4"/>
                        </div>
                    </td>
                </tr>

                <tr>
                    <td>
                        <div class="editor-label">
                           <label for="file">Upload Image5:</label>
                        </div>
                    </td>
                    <td>
                        <div class="editor-field">
                            <input type="file" name="file5" id="file5"/>
                        </div>
                    </td>
                </tr>

                <tr>
                    <td>
                        <div class="editor-label">
                            @Html.LabelFor(model => model.NoOfDisk)
                        </div>
                    </td>
                    <td>
                        <div class="editor-field">
                            @Html.EditorFor(model => model.NoOfDisk)
                            @Html.ValidationMessageFor(model => model.NoOfDisk)
                        </div>
                    </td>
                </tr>

                <tr>
                    <td>
                        <div class="editor-label">
                            @Html.LabelFor(model => model.Weight)
                        </div>
                    </td>
                    <td>
                        <div class="editor-field">
                            @Html.EditorFor(model => model.Weight)
                            @Html.ValidationMessageFor(model => model.Weight)
                        </div>
                    </td>
                </tr>

                <tr>
                    <td>
                        <div class="editor-label">
                            @Html.LabelFor(model => model.Format)
                        </div>
                    </td>
                    <td>
                        <div class="editor-field">
                            @Html.EditorFor(model => model.Format)
                            @Html.ValidationMessageFor(model => model.Format)
                        </div>
                    </td>
                </tr>

            </table>
        </fieldset>
    </td>
    </tr>
    </table>



    </td></tr>

    <tr><td>
        <table><tr><td><fieldset><table>
            <tr>
                <td>
                <p>
                    <input type="submit" value="Create" />
                    <input type="button" value="Clear" id="btnClear" />
                </p>
                </td>
            </tr>
        </table></fieldset></td></tr></table>

    </td></tr>

    </table>

}

@*<div>
    @Html.ActionLink("Back to List", "Index")
</div>
*@
@section Scripts {
    @Scripts.Render("~/bundles/jqueryval")
}

@if (TempData["notice"] != null) 
{
<p style="color:Red;" >@TempData["notice"]</p>
}

解决方案

you are using jquery latest (1.9...) in which $(sel).live(...) was deprecated hence your error message.

1) revert to an older version of jquery.

2) update your code (replace live by on).

3) put back jquery-latest.

这篇关于微软JScript运行时错误:对象不支持属性或方法“活”?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆