Create an application that receives the (Student Id, Student Name, Course Name, Date of Birth) information from a set of students. The application should also display the information of all the students once the data entered.

 .aspx file 

<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="1c.aspx.cs" 

Inherits="StringOperation._1c" %> 

<!DOCTYPE html> 

<html xmlns="http://www.w3.org/1999/xhtml"> 

<head runat="server"> 

    <title></title> 

</head> 

<body> 

    <form id="form1" runat="server"> 

        <div> 

        </div> 

        Student ID :  <asp:TextBox ID="TextBox1" runat="server"></asp:TextBox> 

        <p> 

         Student Name :  <asp:TextBox ID="TextBox2" runat="server"></asp:TextBox> 

        </p> 

        <p> 

          Course Name :  <asp:TextBox ID="TextBox3" runat="server"></asp:TextBox> 

        </p> 

       Date Of Birth :  <asp:Calendar ID="Calendar1" runat="server"></asp:Calendar> 

        <p> 

            <asp:Button ID="Button1" runat="server" OnClick="Button1_Click" Text="Show 

Details" /></p> 

        <asp:Label ID="Label1" runat="server" Text=""></asp:Label> 

          <p>  <asp:Label ID="Label2" runat="server" Text=""></asp:Label> 

        </p> 

        <asp:Label ID="Label3" runat="server" Text=""></asp:Label> 

        <p> 

            <asp:Label ID="Label4" runat="server" Text=""></asp:Label> 

        </p> 

    </form> 

</body> 

</html> 

.aspx.cs file 

using System; 

using System.Collections.Generic; 

using System.Linq; using System.Web; 

using System.Web.UI; 

using System.Web.UI.WebControls; 

namespace StringOperation 

{    

 public partial class _1c : System.Web.UI.Page 

    { 

        protected void Page_Load(object sender, EventArgs e) 

        { 

        } 

        protected void Button1_Click(object sender, EventArgs e) 

        { 

            Label1.Text = "Student ID : " + TextBox1.Text; 

            Label2.Text = "Student Name : " + TextBox2.Text; 

            Label3.Text = "Course Name : " + TextBox3.Text; 

            Label4.Text = "Date of Birth : " + Calendar1.SelectedDate.ToShortDateString(); 

        } 

    } 

Output:- 




Post a Comment

0 Comments