Editable table / asp.net 中的网格与 VB

Editable table / grid in asp.net with VB

我是一名前端开发人员,与 VB 开发人员合作创建一个用于输入数据字段的 Web 应用程序:姓名、目标和截止日期。

我们的客户 希望数据像 Excel 电子表格一样输入:在多个字段中切换并输入数据。然后将输入的数据输出为网格或 table 其他地方以查看/批准。

我主要在 CSS/JS/PHP 工作,而且我对 .ASPX 还很陌生。我们在 .NET 4.0 框架中工作,后端 VB 运行 连接到 SQL 服务器。在 前端,我们有 .ASPX 网络表单以及 CSS/JS.

请注意:不是 MVC 或核心框架,而是一个较旧的 4.0 .NET 框架。

我们已经尝试了多种选择,但是 none 其中的选择符合我们客户的要求。我已经尝试将其作为 <asp:Table><input> 字段,以及 <table><asp:TextBox> 输入字段。但是我们 运行 都遇到了问题。我们还尝试了 <asp:GridView> 但这也没有用。它只是只读的,不是 editable。而且一次只能编辑一行。客户希望整个 table/grid 成为 editable。下面的代码示例。问题在于每个 ID 都是不同的名称:TextBox1、TextBox2 等。这对 VB 无法将记录保存到数据库。

有人构建过类似的 Web 应用程序吗?什么对你有用?

<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
<div class="obj-table">
        <table>
            <tr>
                <td>
                    <asp:Label ID="Label1" CssClass="label name" runat="server" Text="Name"></asp:Label></td>
                <td>
                    <asp:Label ID="Label2" CssClass="label" runat="server" Text="Objective"></asp:Label></td>
                <td>
                    <asp:Label ID="Label3" CssClass="label" runat="server" Text="Due Date"></asp:Label></td>
                <td>
                    <asp:Label ID="Label4" CssClass="checkbox" runat="server" Text="Approved"></asp:Label></td>
            </tr>
            <tr>
                <td>
                    <asp:TextBox ID="Name" CssClas="textbox" runat="server"></asp:TextBox>
                </td>

                <td>
                    <asp:TextBox ID="Descrp" CssClas="textbox" runat="server"></asp:TextBox>
                </td>

                <td>
                    <asp:TextBox ID="DueDate" CssClas="textbox" runat="server"></asp:TextBox>
                </td>

                <td>
                    <asp:CheckBox ID="CheckBox" runat="server"/>
                </td>

                <%-- use this for when we need a drop down menu 
                <td>
                    <asp:DropDownList ID="DropDown" runat="server"></asp:DropDownList>
                </td>--%>
            </tr>
            <tr>
                <td>
                    <asp:TextBox ID="TextBox1" runat="server"></asp:TextBox>
                </td>

                <td>
                    <asp:TextBox ID="TextBox2" runat="server"></asp:TextBox>
                </td>

                <td>
                    <asp:TextBox ID="TextBox3" runat="server"></asp:TextBox>
                </td>

                <td>
                    <asp:CheckBox ID="CheckBox1" runat="server"/>
                </td>
            </tr>
            <tr>
                <td>
                    <asp:TextBox ID="TextBox4" runat="server"></asp:TextBox>
                </td>

                <td>
                    <asp:TextBox ID="TextBox5" runat="server"></asp:TextBox>
                </td>

                <td>
                    <asp:TextBox ID="TextBox6" runat="server"></asp:TextBox>
                </td>

                <td>
                    <asp:CheckBox ID="CheckBox2" runat="server"/>
                </td>
            </tr>
        </table>
</div>

您可以使用网格视图元素,它会与 asp sql 数据源对象

同步自动执行您想要的操作