Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/fortran/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Asp.net Gridview编辑不工作_Asp.net_.net_Vb.net_Visual Studio 2008 - Fatal编程技术网

Asp.net Gridview编辑不工作

Asp.net Gridview编辑不工作,asp.net,.net,vb.net,visual-studio-2008,Asp.net,.net,Vb.net,Visual Studio 2008,我有以下gridview: <asp:GridView ID="GrdAll" runat="server" AutoGenerateColumns="false" ShowHeader="false" Width="40%" GridLines="None" CellPadding="2" CellSpacing="2"> <AlternatingRowStyle CssClass="AltColor22" /> <

我有以下gridview:

<asp:GridView ID="GrdAll" runat="server" AutoGenerateColumns="false" ShowHeader="false"
        Width="40%" GridLines="None" CellPadding="2" CellSpacing="2">
        <AlternatingRowStyle CssClass="AltColor22" />
        <RowStyle CssClass="AltColor21" />
        <Columns>
            <asp:TemplateField>
                <ItemTemplate>
                    <table width="100%" class="TableBorder">
                        <tr>
                            <td valign="top" align="left">
                                <asp:Label ID="lblName" runat="server" />
                                <hr />
                            </td>
                        </tr>
                        <tr>
                            <td valign="top" align="left" class="TableBorder">
                                <asp:GridView ID="GrdContent" runat="server" AutoGenerateColumns="False"
                                    Width="100%" GridLines="None" CellPadding="2" CellSpacing="2" 
                                    OnRowDataBound="GrdContent_RowDataBound" OnRowEditing="GrdContent_RowEditing"><%----%>
                                    <Columns>
                                        <asp:TemplateField HeaderText="Kiosk ID" HeaderStyle-HorizontalAlign="Left">
                                            <ItemTemplate>
                                                <asp:Label ID="lblKiosID" runat="server"></asp:Label>
                                            </ItemTemplate>
                                              <EditItemTemplate>
                                                <asp:TextBox ID="txtKiosk" runat="server" Text ='<%#Eval("HBEmailID") %>'></asp:TextBox>
                                            </EditItemTemplate>
                                            <HeaderStyle HorizontalAlign="Left" />
                                        </asp:TemplateField>

                                        <asp:TemplateField HeaderText="Email ID" HeaderStyle-HorizontalAlign="Left">
                                         <HeaderStyle HorizontalAlign="Left" />
                                            <ItemTemplate>
                                                <asp:Label ID="lblEmail" runat="server"></asp:Label>
                                            </ItemTemplate>

                                            <EditItemTemplate>
                                                <asp:TextBox ID="txtEmail" runat="server" Text ='<%#Eval("HBEmailID") %>'></asp:TextBox>
                                            </EditItemTemplate>

                                        </asp:TemplateField>
                                        <asp:TemplateField ShowHeader="False">
                                            <ItemTemplate>
                                                <asp:LinkButton ID="LinkButton1" runat="server"  CommandName="Edit"
                                                    Text="Edit" ></asp:LinkButton>
                                            </ItemTemplate>
                                            <EditItemTemplate>
                                                <asp:LinkButton ID="LinkButton3" runat="server"  CommandName="Update"
                                                    Text="Update"></asp:LinkButton>
                                                &nbsp;<asp:LinkButton ID="LinkButton2" runat="server"  CommandName="Cancel"
                                                    Text="Cancel"></asp:LinkButton>
                                            </EditItemTemplate>
                                        </asp:TemplateField>
                                    </Columns>
                                </asp:GridView>
                            </td>
                        </tr>
                    </table>
                </ItemTemplate>
            </asp:TemplateField>
        </Columns>
    </asp:GridView>

请帮助我,它不会给我错误,但也不会显示要编辑的文本框。

问题可能出在以下代码上

bindContentGrid(CType(row.FindControl("GrdContent"), GridView), DBName)

如果该代码未返回任何记录,则不会显示任何内容。请确保它返回了一些行。

c#
标记已删除,这是不相关的。不,c#中的相关答案也可以帮助我,我在两个地方提到过。尝试在行编辑事件上设置断点,并使用Try-catch查找单击编辑时出现的错误或值
bindContentGrid(CType(row.FindControl("GrdContent"), GridView), DBName)