Click here to Skip to main content
16,011,870 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
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.NET
<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
.......
VB
 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
Posted
Updated 29-Nov-11 1:37am
v2
Comments
Karthik Harve 29-Nov-11 7:47am    
by default panel visibility will be true. again you are making to true. Exactly what do you want to do with these panels..??

1 solution

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" />
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month


CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900