小编Bar*_*nes的帖子

Delphi IDE线长

在Delphi 7 IDE中,线条是否需要给定长度?在我正在使用的一些Delphi代码中看到一条灰色线条,它看起来就像它前面的行结束一样.

delphi delphi-7

4
推荐指数
2
解决办法
1435
查看次数

通过按钮onclick事件在ASP.NET中创建动态表

这是我的要求:

  • 我有一个下拉列表和文本框(appName和profile).
  • 我想从下拉列表和文本框中获取值,并将它们添加到表(或像gridview一样的控件呈现到表中)
  • 在某些时候,我希望能够遍历表并将值提交给数据库.

我的问题:

  • 由onClick引起的回发甚至将表格仅显示为输入的最后一个值,并且不保留任何先前的值.

笔记:

  • 我试图使用绑定到数据网格的数据列表来工作,但没有运气.

码:

    protected void addAppButton_Click(object sender, EventArgs e)
    {
        DropDownList appList = (DropDownList)newEntryFV.FindControl("appList");
        TextBox profileTextBox = (TextBox)newEntryFV.FindControl("profileTextBox");
        addAppsToTable(appList.SelectedValue.ToString(), profileTextBox.Text.ToString());
    }

    private void addAppsToTable(string appName, string profileName)
    {
        Table appsTable = (Table)newEntryFV.FindControl("appTable");
        TableRow newRow = new TableRow();
        TableCell appNameCell = new TableCell();
        TableCell profileCell = new TableCell();
        appNameCell.Text = appName;
        profileCell.Text = profileName;
        newRow.Cells.Add(appNameCell);
        newRow.Cells.Add(profileCell);
        appsTable.Rows.Add(newRow);
    }
Run Code Online (Sandbox Code Playgroud)

解决我的问题的代码:

    [Serializable]
    public class securityApps
    {
        public string secAppID { get; set; }
        public string secAppName { …
Run Code Online (Sandbox Code Playgroud)

c# asp.net

4
推荐指数
1
解决办法
1486
查看次数

标签 统计

asp.net ×1

c# ×1

delphi ×1

delphi-7 ×1