在显示正确/错误的情况下,面板无法正常工作 [英] Panel are not working proparly in the case of Visible True/False

查看:95
本文介绍了在显示正确/错误的情况下,面板无法正常工作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

先生,

我带一个面板,其中有文本框,比率按钮,按钮,日历.
加载页面时表示第一个面板为False.
我有一个按钮,当我单击该按钮时,面板显示为ture.但是不起作用.

参见面板6



ASPX页面.
..........

Sir,

I take a panel in which i have textbox,ratio button,button,calender.
When page is loaded means first panel is False.
I have one button by which, when i click then Panel is ture.but it is not working.

See the Panel6



ASPX PAGE.
..........

<asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False"  

        AllowSorting="True" AutoGenerateEditButton="false" 

        OnRowEditing="GridView1_RowEditing" 

        OnRowCancelingEdit="GridView1_RowCancelingEdit" 

        OnRowUpdating="GridView1_RowUpdating" 

        BorderColor="SaddleBrown" BorderStyle="None" CellPadding="4" 

        ForeColor="#333333" GridLines="None" PageSize="15" AllowPaging="True" ShowFooter="true">

            <columns>

            <asp:TemplateField HeaderText ="IDNO" Visible="false"><itemtemplate><asp:Label ID="lblid" runat ="server" Text ='<%#Eval("entry_id") %>' Visible="false" ></itemtemplate>

             

            <asp:TemplateField HeaderText="Item" ><itemtemplate> <%#Eval("item")%></itemtemplate>

            
            

             <asp:TemplateField HeaderText="Category" ><itemtemplate> <%#Eval("category")%></itemtemplate>

            
            
             <asp:TemplateField HeaderText="Unit" ><itemtemplate> <%#Eval("unit")%></itemtemplate>
             

            <asp:TemplateField HeaderText ="Revenue"><itemtemplate><asp:Label ID="lblid1" runat ="server" Text ='<%#Eval("rev") %>' ></itemtemplate>
                    
           
           

            <asp:TemplateField HeaderText ="Quantity"><itemtemplate><%#Eval("qty")%> </itemtemplate>

           <edititemtemplate>

           <asp:TextBox ID="textbox2" runat ="server" Text ='<%#Eval("qty") %>'>

           </edititemtemplate>

            
            <asp:TemplateField HeaderText="Amount" ><itemtemplate> <%#Eval("amount")%></itemtemplate>

            
            

             <asp:commandfield showeditbutton="True" ControlStyle-Width="50px" ControlStyle-Font-Bold="true" ControlStyle-Font-Underline="true" />
 

            </columns>

            <footerstyle font-bold="True" />

            <rowstyle backcolor="#FFFBD6" forecolor="#333333" />

            <SelectedRowStyle BackColor="" Font-Bold="True" ForeColor="Navy" />

            <pagerstyle horizontalalign="Center" cssclass="gvFooterRow" />

            <HeaderStyle BackColor="#7AB915" Font-Bold="True" ForeColor="White" />

            <alternatingrowstyle backcolor="#CCFF99" />

        
      <br />

    <asp:Panel ID="Panel1" runat="server" BackColor="#9CD73B" Width="300px">
     
    <asp:Panel ID="Panel2" runat="server" BackColor="#9CD73B" Width="300px">
    
    <asp:Panel ID="Panel3" runat="server" BackColor="#9CD73B" Width="300px">
    
    <asp:Panel ID="Panel4" runat="server" BackColor="#9CD73B" Width="300px">
    
    <asp:Panel ID="Panel5" runat="server" BackColor="#9CD73B" Width="300px">
    
   <asp:Button ID="Button4" runat="server" Text="Go For Deposite"  />  

<triggers>
<asp:AsyncPostBackTrigger ControlID = "GridView1" />
</triggers>



     

                
            
            <asp:Panel ID="Panel6" runat="server" Visible="false">
            
            <tr>
                <td>
                               <asp:Label 

                        ID="Label4" runat="server" Text="BR No." Visible="False" Font-Bold="True"><br />
                    <asp:TextBox ID="TextBox3" runat="server" Visible="False">
                </td>
                <td colspan="2">
                    <asp:Label ID="Label5" runat="server" Text="DATE" Visible="False" 

                        Font-Bold="True">
                    <br />
                    <asp:TextBox ID="TextBox4" runat="server" Visible="False">
                    <%--<asp:Button ID="Button2" runat="server" Text="..." Visible="False" />--%>
                    <asp:ImageButton ID="Button2" runat="server" ImageUrl="~/images/cal.gif" />
                     <asp:CalendarExtender ID="CalendarExtender2" runat="server" 



Enabled="True" PopupButtonID="Button2" TargetControlID="TextBox4" Format="dd/MM/yyyy">


                </td>
                <td colspan="2">
                    <asp:Label ID="Label6" runat="server" Text="Amount" Visible="False" 

                        Font-Bold="True">
                    <br />
                    <asp:TextBox ID="TextBox5" runat="server" Visible="False">
                 <asp:CheckBox ID="CheckBox1" runat="server" Text="Deposited" Visible="False" 

                        Font-Bold="True" ForeColor="#FF3300" />
                </td>
                <td>
                    <asp:Button ID="Button3" runat="server" Text="Submit" Visible="False" 

                        BackColor="#9CD73B" />
                </td>
            </tr>




CODE PAGE
.......




CODE PAGE
.......

 Protected Sub Button4_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button4.Click

        Panel1.Visible = True
        Panel2.Visible = True
        Panel3.Visible = True
        Panel4.Visible = True
        Panel5.Visible = True
        Panel6.Visible = True

    End Sub
End Class

推荐答案

I think Your complete code is in update panal.

So when you are clicking on the button the page is not doing the post back.


for that you can do AsyncPostBack for button also

add This :

I think Your complete code is in update panal.

So when you are clicking on the button the page is not doing the post back.


for that you can do AsyncPostBack for button also

add This :

<asp:asyncpostbacktrigger controlid="Button4" xmlns:asp="#unknown" />


这篇关于在显示正确/错误的情况下,面板无法正常工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆