Javascript运行时错误:无法设置undefined或null的引用的value属性 [英] Javascript runtime error: couldn't set value property of reference that undefined or null

查看:232
本文介绍了Javascript运行时错误:无法设置undefined或null的引用的value属性的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何修复JavaScript运行时错误:无法设置引用的值属性为undefined或null错误?

或为什么会发生?





当我点击删除按钮时出现此错误。



i分享我的代码:



How can i fix the "JavaScript Runtime Error: Couldn't set Value property of Reference that undefined or null" error?
or why its happen?


when i click the delete button i got this error.

i share my code:

<asp:GridView ID="gvSepet" runat="server" CellPadding="4" DataKeyNames="sepetID" CssClass="table cart" GridLines="None" AutoGenerateColumns="False" ShowFooter="false" OnRowDeleting="gvSepet_RowDeleting">
                            <AlternatingRowStyle BackColor="White" />
                            <Columns>
                                <asp:CommandField ShowDeleteButton="True" ItemStyle-CssClass="cart-product-remove" ButtonType="Image" DeleteImageUrl="images/icon-trash2.png">
                                    <ItemStyle HorizontalAlign="Center" />
                                </asp:CommandField>
                                <asp:ImageField DataImageUrlField="resimyolu1" ItemStyle-CssClass="cart-product-thumbnail"></asp:ImageField>
                                <asp:BoundField DataField="urunad" HeaderText="Ürün Adı" ItemStyle-CssClass="cart-product-name" />
                                <asp:BoundField DataField="fiyat" HeaderText="Fiyat" ItemStyle-CssClass="cart-product-price">
                                    <ItemStyle HorizontalAlign="Right" />
                                </asp:BoundField>
                                <asp:BoundField DataField="adet" HeaderText="Adet" ItemStyle-CssClass="cart-product-quantity">
                                    <ItemStyle HorizontalAlign="Center" />
                                </asp:BoundField>
                                <asp:BoundField DataField="tutar" HeaderText="Tutar" ItemStyle-CssClass="cart-product-subtotal">
                                    <ItemStyle HorizontalAlign="Right" />
                                </asp:BoundField>

                            </Columns>
                            <EmptyDataTemplate>
                                <h3>Sepetinizde ürün bulunmamaktadır.</h3>
                            </EmptyDataTemplate>
                        </asp:GridView>







protected void gvSepet_RowDeleting(object sender, GridViewDeleteEventArgs e)
        {
            DataTable dt = (DataTable)Session["sepet"];
            dt.Rows.RemoveAt(e.RowIndex);
            Session["sepet"] = dt;
            SepetGoster(dt);
        }





我的尝试:



i无法为此错误做任何事情



What I have tried:

i cant doing anything for this error

推荐答案

Quote:

JavaScript运行时错误:无法设置未定义或null的引用的Value属性

JavaScript Runtime Error: Couldn't set Value property of Reference that undefined or null

该消息表示由于某种原因该变量不包含预期的对象。

使用调试器查看到底出了什么问题。

我认为你必须添加代码来检查变量是否为NULL。

The message means that for some reason the variable do not contain the expected object.
Use the debugger to see exactly what is wrong.
I think you will have to add code to check if the variable is not NULL.


这篇关于Javascript运行时错误:无法设置undefined或null的引用的value属性的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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