I need to make Functional the hide panel imagebutton.

Using The Code
I need to make Functional the hide panel imagebutton.
- The Panel becomes visible when a row in the gridview is selected.
- The Panel is hidden/closed when the imagebutton is clicked.

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

namespace Psc.EmployeeMaintenance.wrkStations
{
    public class EmployeewrkStations
    {
        private Admin.iAdminClient _ws = new Admin.iAdminClient();
        
        public List<Admin.vwEmployee> GetEmployees(out string strReturnMessage, int tSiteID, bool blDisabled)
        {

            List<Admin.vwEmployee> EmployeeAdminList = new List<Admin.vwEmployee>();

            try
            {
                EmployeeAdminList = this._ws.GetEmployees(out strReturnMessage, tSiteID, blDisabled);
            }
            catch (Exception ex)
            {
                strReturnMessage = ex.Message.ToString();
            }

            return EmployeeAdminList;
        }
        
    }
}

Open in new window


                <div class="GridViewClass">
                    <asp:Label cssclass="CurvedTitleVED" ID="lblTitleVED" runat="server"/>
                    <asp:CheckBox ID="chkShowInactiveRecords" runat="server" Text="Show Inactive Records" AutoPostBack="true" CssClass="CssChkBoxShowDisabled" OnCheckedChanged="chkShowInactiveRecords_CheckedChanged" Width="200px"/>
                    <asp:GridView ID="grdEmployAdmin" runat="server" AutoGenerateColumns="False" AutoGenerateSelectButton="True" DataSourceID="dsEmployObject" AllowPaging="True" PageSize="20" CssClass="CssZMGrid" OnItemDatabound="FormatGrid" CellPadding="4" ForeColor="#333333" GridLines="None">
                        <Columns>
                            <asp:BoundField DataField="FullName" HeaderText="FullName" SortExpression="FullName" />
                            <asp:BoundField DataField="EmployeeNumber" HeaderText="EmployeeNumber" SortExpression="EmployeeNumber" />
                            <asp:BoundField DataField="BadgeNumber" HeaderText="BadgeNumber" SortExpression="BadgeNumber" />
                            <asp:BoundField DataField="DepartmentName" HeaderText="DepartmentName" SortExpression="DepartmentName" />
                            <asp:BoundField DataField="HireDate" HeaderText="HireDate" SortExpression="HireDate" />
                            <asp:BoundField DataField="JobTitleDescription" HeaderText="JobTitleDescription" SortExpression="JobTitleDescription" />
                            <asp:BoundField DataField="EmployeeID" Visible="false" />
                        </Columns>
                        <AlternatingRowStyle BackColor="White" />
                        <EditRowStyle BackColor="#2461BF" />
                        <FooterStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
                        <HeaderStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
                        <PagerStyle BackColor="#2461BF" ForeColor="White" HorizontalAlign="Center" />
                        <RowStyle BackColor="#EFF3FB" />
                        <SelectedRowStyle BackColor="#D1DDF1" Font-Bold="True" ForeColor="#333333" />
                        <SortedAscendingCellStyle BackColor="#F5F7FB" />
                        <SortedAscendingHeaderStyle BackColor="#6D95E1" />
                        <SortedDescendingCellStyle BackColor="#E9EBEF" />
                        <SortedDescendingHeaderStyle BackColor="#4870BE" />
                    </asp:GridView>
                    <asp:ObjectDataSource ID="dsEmployObject" runat="server" SelectMethod="GetEmployees" TypeName="Psc.EmployeeMaintenance.Factories.EmployeewrkStation">
                        <SelectParameters>
                            <asp:Parameter DefaultValue="" Direction="Output" Name="strReturnMessage" Type="String" />
                            <asp:Parameter DefaultValue="1" Name="tSiteID" Type="Int32" />
                            <asp:Parameter DefaultValue="false" Name="blDisabled" Type="Boolean" />
                        </SelectParameters>
                    </asp:ObjectDataSource>
				</div>
                <div>
                    <div class="AddClass">
                        <asp:panel id="DisplayAddPanelAll" runat="server" visible="true">
                        <!---Custom Summary--->
                            <asp:Label ID="EmployeeID" runat="server" Visible="false"/>
                            <asp:Label cssclass="CurvedTitleAdd" ID="lblEmployeeID" runat="server"/>

                            <asp:Label runat="server" ID="lblEmployeeNumber" CssClass="CssAddlblEmployeeNumber" Text="Employee #:"/>     
                            <asp:TextBox runat="server" ID="txtEmployeeNumber" MaxLength="50" Width="175px" CssClass="CssAddtxtEmployeeNumber"/>

                            <asp:Label runat="server" ID="lblFirstName" CssClass="CssAddlblFirstName" Text="First Name:"/>     
                            <asp:TextBox runat="server" ID="txtFirstName" MaxLength="50" Width="175px" CssClass="CssAddtxtFirstName" OnTextChanged="txtFirstName_TextChanged"/>

                            <asp:Label runat="server" ID="lblKnownName" CssClass="CssAddlblKnownName" Text="Known Name:"/>     
                            <asp:TextBox runat="server" ID="txtKnownName" MaxLength="50" Width="175px" CssClass="CssAddtxtKnownName"/>

                            <asp:Label runat="server" ID="lblMiddleName" CssClass="CssAddlblMiddleName" Text="Middle Name:"/>     
                            <asp:TextBox runat="server" ID="txtMiddleName" MaxLength="50" Width="175px" CssClass="CssAddtxtMiddleName"/>

                            <asp:Label runat="server" ID="lblLastName" CssClass="CssAddlblLastName" Text="Last Name:"/>     
                            <asp:TextBox runat="server" ID="txtLastName" MaxLength="50" Width="175px" CssClass="CssAddtxtLastName"/>

                            <asp:Label runat="server" ID="lblDepartmentID" CssClass="CssAddlblDepartmentID" Text="Department:"/>     
                            <asp:dropdownlist runat="server" ID="ddlDepartmentID" CssClass="CssAddddlDepartmentID" AutoPostBack="True"/>

                            <asp:Label runat="server" ID="lblJobTitleID" CssClass="CssAddlblJobTitleID" Text="Job Title:"/>     
                            <asp:dropdownlist runat="server" ID="ddlJobTitleID" CssClass="CssAddddlJobTitleID" AutoPostBack="True"/>

                            <asp:Label runat="server" ID="lblHireDate" CssClass="CssAddlblHireDate" Text="Hire Date:"/>     
                            <asp:TextBox runat="server" ID="txtHireDate" MaxLength="50" Width="175px" CssClass="CssAddtxtHireDate" AutoPostBack="True"/>

                            <asp:Label runat="server" ID="lblBirthDate" CssClass="CssAddlblBirthDate" Text="Birth Date:"/>     
                            <asp:TextBox runat="server" ID="txtBirthDate" MaxLength="50" Width="175px" CssClass="CssAddtxtBirthDate"/>

                            <asp:Label runat="server" ID="lblEmailAddress" CssClass="CssAddlblEmailAddress" Text="Email:"/>     
                            <asp:TextBox runat="server" ID="txtEmailAddress" MaxLength="50" Width="175px" CssClass="CssAddtxtEmailAddress"/>

                            <asp:Label runat="server" ID="lblEmergencyContactName" CssClass="CssAddlblEmergencyContactName" Text="Emergency Contact Name:"/>     
                            <asp:TextBox runat="server" ID="txtEmergencyContactName" MaxLength="50" Width="175px" CssClass="CssAddtxtEmergencyContactName"/>

                            <asp:Label runat="server" ID="lblEmergencyContactPhone" CssClass="CssAddlblEmergencyContactPhone" Text="Emergency Contact Phone:"/>     
                            <asp:TextBox runat="server" ID="txtEmergencyContactPhone" MaxLength="50" Width="175px" CssClass="CssAddtxtEmergencyContactPhone"/>

                            <asp:Label runat="server" ID="lblInactive" CssClass="CssAddlblInactive" Text="Disabled Date/Time:"/>     
                            <asp:dropdownlist runat="server" ID="txtInactive" MaxLength="50" Width="175px" CssClass="CssAddtxtInactive"/>

                            <asp:ImageButton ID="btnHideEmployeeAdminPanelButton" runat="server" CssClass="CssHideEmployeeAdminPanelButton" ImageUrl="~/images/close.png"  Width="20" Height="20"/>
                            <asp:ImageButton ID="btnSaveEmployeeAdminPanelButton" runat="server" CssClass="CssSaveEmployeeAdminPanelButton" ImageUrl="~/images/save-icon.png"  Width="40" Height="40"/>

                        </asp:panel>
                    </div>
                </div>

Open in new window

RedXavier2k4Asked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

RedXavier2k4Author Commented:
I am wondering about the postback and if an event if being triggered. I can click on the button to close it but it just does a postback to the page and the event "btnHideEmployeeAdminPanelButton_Click(object sender, ImageClickEventArgs e)" is never triggered.
        //
        //--- Button Hide Panel
        protected void btnHideEmployeeAdminPanelButton_Click(object sender, ImageClickEventArgs e)
        {
            Panel EmployPanel = new Panel();

            //DisplayAddPanelAll.Visible = true;
            EmployPanel .Visible = false;
        }

Open in new window

0
RedXavier2k4Author Commented:
The code was correct I had a postback issue due to a javascript issue.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
RedXavier2k4Author Commented:
thanks to whomever racked their brain like I did and couldn't find anything wrong.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
ASP.NET

From novice to tech pro — start learning today.