Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/csharp/296.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

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/asp.net/37.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# 简单的Gridview和按钮问题。我正在学习Asp.Net。请帮帮我!_C#_Asp.net_Html - Fatal编程技术网

C# 简单的Gridview和按钮问题。我正在学习Asp.Net。请帮帮我!

C# 简单的Gridview和按钮问题。我正在学习Asp.Net。请帮帮我!,c#,asp.net,html,C#,Asp.net,Html,我不会说我浪费了时间,但我花了几个小时来改变这个。但这是徒劳的。谁能帮我一下吗 在以下代码中: 我需要在禁用位置(标题)和gridview之间使用中断 我希望网格的边框颜色为“无”。我不想要任何颜色 我希望两个按钮禁用或停用和取消显示在gridview的正下方。在页面的中间。 禁用位置 我需要这里的1号 <asp:GridView ID="disableloc" runat="server" AutoGenerateColumns="False" DataK

我不会说我浪费了时间,但我花了几个小时来改变这个。但这是徒劳的。谁能帮我一下吗

在以下代码中:

  • 我需要在禁用位置(标题)和gridview之间使用中断
  • 我希望网格的边框颜色为“无”。我不想要任何颜色
  • 我希望两个按钮禁用或停用和取消显示在gridview的正下方。在页面的中间。

    
    禁用位置
    
  • 我需要这里的1号

                <asp:GridView ID="disableloc" runat="server" AutoGenerateColumns="False" DataKeyNames="LocationName"
                    DataSourceID="" AllowPaging="True" EnableViewState="true" BorderStyle="None">
    
    
    
    我想我想要两个在这里

                </asp:GridView>
    
    
    
    我想要3个在这里

                <tr align ="center" style="position:fixed">
                   <asp:ImageButton ID="btnDisable" runat="server" ImageAlign="Middle" ImageUrl="~/images/green-deactivate.gif" OnClick="btnDisable_Click"
                        ValidationGroup="group1" />
    
                   <asp:ImageButton ID="btnCancel" runat="server" ImageUrl="~/images/cancel.gif" OnClick="btnCancel_Click" />
    
                </tr>
             </table>
    
        </div>
    
    
    
  • 在页眉td样式中使用padding bottom以获得适当的间距
  • 在GridView上使用gridlines=“无”
  • 将Gridview和按钮放入td:s以正确放置

  • 这是相当基本的HTML/CSS知识(这没什么错),但调查基本信息源可能会帮助您自助

    关于您的具体项目:

    • “中断”可以像控件之间的

      语句一样简单
    • 如果您不想要颜色:
      #88b9c7
      和类似外观的语句都是颜色
    • 在使用表格时,可以将按钮放置在正确的
      /
    对于#1,尝试在
    td
    上使用
    边距
    填充
    ,或在
    span
    中包装“禁用位置”(或其他内容),并设置其边距/填充样式以留出一些空间

    对于#2,请尝试在GridView上设置


    对于#3,请确保在
    中有一个
    ,并尝试在
    td
    或包装按钮的
    div上使用
    text align:center
    。或者,不要将其放在表格中,只需将它们放在表格正下方的一个div中,并使用
    text align:center
    (您需要表格吗?

    您是否可以按原样发布HTML而不将其拆分,这样可能更容易看到页面的外观。抱歉!我从未意识到!从现在起我会这么做的。也将纠正以前的错误。感谢您让我知道。常见问题解答的可能副本位于。请读一下。我敢肯定,在某个地方,它说不要发布重复的问题(假设这不仅仅是普通的礼貌)。+1。对这个问题有不同的解释,但答案很好。
                <tr align ="center" style="position:fixed">
                   <asp:ImageButton ID="btnDisable" runat="server" ImageAlign="Middle" ImageUrl="~/images/green-deactivate.gif" OnClick="btnDisable_Click"
                        ValidationGroup="group1" />
    
                   <asp:ImageButton ID="btnCancel" runat="server" ImageUrl="~/images/cancel.gif" OnClick="btnCancel_Click" />
    
                </tr>
             </table>
    
        </div>