你好 请帮我看看是不是我的问题啊

Nov 17, 2009 at 2:08 PM
Edited Nov 17, 2009 at 3:06 PM

我为了把登陆按钮放在右边 就用了toolbar和ToolbarFill1  但是这样写后  登陆按钮的后台代码就不执行

如果去掉<ext:Button ID="Button1" runat="server" Text="登陆" Type="Submit" ValidateForms="SimpleForm1" onclick="Button1_Click" Icon="Accept">代码中的ValidateForms="SimpleForm1" 就能正常  如果不放在toolbar里面 也正常(必须删除toolbar控件) 请指点一下  谢谢 

 

窗体代码如下:

<body>
    <form id="form1" runat="server">
    <div>        
   <ext:PageManager ID="PageManager1" runat="server" />
    <ext:Window ID="Window1" runat="server" Title="登陆" EnableClose="false" Width="250px" >
        <Items>
            <ext:SimpleForm ID="SimpleForm1" runat="server" ShowBorder="false" BodyPadding="10px"
                EnableBackgroundColor="true" ShowHeader="false">
                <Items>
                    <ext:TextBox ID="tbxUserName" Label="用户名" Required="true"  runat="server"  CompareOperator ="Equal"  >
                    </ext:TextBox>
                    <ext:TextBox ID="tbxPassword" Label="密  码" TextMode="Password" Required="true"
                        runat="server" CompareOperator="Equal">
                    </ext:TextBox>
                     <ext:Toolbar  runat ="server" >           
                      <Items >
                       <ext:ToolbarFill ID ="ToolbarFill1" runat ="server">
                         </ext:ToolbarFill>
                            <ext:Button ID="Button1" runat="server" Text="登陆" Type="Submit" ValidateForms="SimpleForm1"
                         onclick="Button1_Click" Icon="Accept">
                         </ext:Button>
                      </Items>
                   </ext:Toolbar>
                 </Items>
              </ext:SimpleForm>
        </Items>
    </ext:Window>
    </div>
    </form>
</body>

 

 

Coordinator
Nov 19, 2009 at 12:32 PM

原因很简单了,你把Toolbar的位置放错了,正确的写法是:

<ext:PageManager ID="PageManager1" runat="server" />
    <ext:Window ID="Window1" runat="server" Title="登陆" EnableClose="false" Width="250px">
        <Items>
            <ext:SimpleForm ID="SimpleForm1" runat="server" ShowBorder="false" BodyPadding="10px"
                EnableBackgroundColor="true" ShowHeader="false">
                <Toolbars>
                    <ext:Toolbar ID="Toolbar1" runat="server">
                        <Items>
                            <ext:ToolbarFill ID="ToolbarFill1" runat="server">
                            </ext:ToolbarFill>
                            <ext:Button ID="Button1" runat="server" Text="登陆" Type="Submit" ValidateForms="SimpleForm1"
                                OnClick="Button1_Click" Icon="Accept">
                            </ext:Button>
                        </Items>
                    </ext:Toolbar>
                </Toolbars>
                <Items>
                    <ext:TextBox ID="tbxUserName" Label="用户名" Required="true" runat="server" CompareOperator="Equal">
                    </ext:TextBox>
                    <ext:TextBox ID="tbxPassword" Label="密  码" TextMode="Password" Required="true" runat="server"
                        CompareOperator="Equal">
                    </ext:TextBox>
                </Items>
            </ext:SimpleForm>
        </Items>
    </ext:Window>

Nov 19, 2009 at 2:11 PM

谢谢指点 已经成了