Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/csharp/287.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
C# 如何使用c向asp.net页面添加按钮矩阵#_C#_Asp.net_Visual Studio 2008 - Fatal编程技术网

C# 如何使用c向asp.net页面添加按钮矩阵#

C# 如何使用c向asp.net页面添加按钮矩阵#,c#,asp.net,visual-studio-2008,C#,Asp.net,Visual Studio 2008,对于如何在ASPX中向页面添加相同大小的按钮(50列*10行)的整个矩阵,您有什么建议吗?页面甚至可以在加载时自动填充按钮。 我的第一个想法是使用double: FOR(i=1; i<=10;i++) { FOR(j=1; j<=50;++) { Create button; Add button to panel; (to the right of the previous button) Set button caption to ij; } Go to the next ro

对于如何在ASPX中向页面添加相同大小的按钮(50列*10行)的整个矩阵,您有什么建议吗?页面甚至可以在加载时自动填充按钮。 我的第一个想法是使用double:

FOR(i=1; i<=10;i++)
{
FOR(j=1; j<=50;++)
{
Create button;
Add button to panel; (to the right of the previous button)
Set button caption to ij; 
}
Go to the next row of buttons.
}

对于(i=1;i您可以添加一行,然后添加System.Web.UI.HtmlControl.GenericControl(“br”)以每一个按钮一个段落开始新的一行

你不会得到一个矩阵。一个非常原始的解决方案可能是使用一个表格。即使一个页面有500个按钮…也会相当重。你真的需要吗?谢谢,阿德里亚诺。实际上,为了得到矩阵,每一行后面都有一个段落。但不确定如何将其插入C#。我需要它用于剧院座位位置,这就是为什么500个地方。你不需要一个真正的按钮。如果你不能使用HTML5(画布)和Flash / Silverlight不是选项,那么你可以考虑使用(例如)一张图像地图。选择一张剧院地图的图像。创建图像地图(一次而不是从代码)。看看这里:(从主页上你可以在线构建你自己的图像地图)。同意上面的-500按钮是一种效率相当低的方法。要添加到它,你可以使用jQuery(请参阅)