Click here to Skip to main content
15,893,487 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
please tell me how to do this task without database

below is Employeeform.aspx file

XML
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Employeeform.aspx.cs" Inherits="Employeeform" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
</head>
<body>
    <form id="form1" runat="server">
    <table border="0" cellpadding="0" cellspacing="0" width="100%">
        <tr>
            <td align="center">
                <h1>
                    Employee Form</h1>
            </td>
        </tr>
        <tr>
            <td>
            </td>
        </tr>
        <tr>
            <td align="center">
                <table border="0" cellpadding="0" cellspacing="0" width="40%">
                    <tr>
                        <td align="right">
                            <asp:Label ID="EmpNameLb" runat="server" Text="Employee Name"></asp:Label>
                        </td>
                        <td align="left">
                            <asp:TextBox ID="txtempName" runat="server"></asp:TextBox>
                        </td>
                    </tr>
                    <tr>
                        <td align="right">
                            <asp:Label ID="EmpAddLb" runat="server" Text="Employee address"></asp:Label>
                        </td>
                        <td align="left">
                            <asp:TextBox ID="txtempAdd" runat="server" TextMode="MultiLine"></asp:TextBox>
                        </td>
                    </tr>
                    <tr>
                        <td align="right">
                            <asp:Label ID="genderLb" runat="server" Text="Gender"></asp:Label>
                        </td>
                        <td align="left">
                            <asp:RadioButtonList ID="RadioButtonList1" runat="server" RepeatDirection="Horizontal">
                                <asp:ListItem Value="1">Male</asp:ListItem>
                                <asp:ListItem Value="2">Female</asp:ListItem>
                            </asp:RadioButtonList>
                        </td>
                    </tr>
                    <tr>
                        <td align="right">
                            <asp:Label ID="QualifnLb" runat="server" Text="Qualifaication"></asp:Label>
                        </td>
                        <td align="left">
                            <asp:DropDownList ID="DropDownList1" runat="server" Height="16px" Width="138px">
                                <asp:ListItem Value="0">Select</asp:ListItem>
                                <asp:ListItem Value="1">M.Tech</asp:ListItem>
                                <asp:ListItem Value="2">B.Tech</asp:ListItem>
                                <asp:ListItem Value="3">B.Sc</asp:ListItem>
                            </asp:DropDownList>
                        </td>
                    </tr>
                    <tr>
                        <td align="center" colspan="2">
                            <asp:Button ID="submitBtn" runat="server" Text="Submit" />
                        </td>
                    </tr>
                </table>
            </td>
        </tr>
        <tr>
            <td>
            </td>
        </tr>
        <tr>
            <td align="center">
                <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="false">
                    <Columns>
                        <asp:BoundField HeaderText="EmpName" DataField="EmployeeName" />
                        <asp:BoundField HeaderText="EmpAddress" DataField="EmployeeAddress" />
                        <asp:BoundField HeaderText="Gender" DataField="Gender" />
                        <asp:BoundField HeaderText="Qualification" DataField="Qualification" />
                    </Columns>
                </asp:GridView>
            </td>
        </tr>
        <tr>
            <td>
            </td>
        </tr>
        <tr>
            <td>
            </td>
        </tr>
    </table>
    </form>
</body>
</html>
Posted
Comments
DamithSL 11-Jun-14 0:05am    
what have you tried so far?
Sunasara Imdadhusen 11-Jun-14 2:10am    
You can create DataTable to store your values and bind your DataTable to DataGridView source
Prasad Avunoori 11-Jun-14 6:39am    
you should use Session or ViewState besides Datatable.

create datatable and add value and bind it on button click
 
Share this answer
 
create one dataset or data table and add your employee detail in that and bind that to your grid.
 
Share this answer
 

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



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