Akshit Jindal ASP - Net File
Akshit Jindal ASP - Net File
ASP.NET
Session 2023-24
INDEX
S.NO. PROGRAM NAME PAGE NO.
1. WRITE A SIMPLE PROGRAM USING C# 1
2. WRITE A PROGRAM TO SHOW 2
ARITHMETIC OPERATORS USING C#.
3. WRITE A PROGRAM TO SHOW 3
CONDITIONAL OPERATORS USING C#.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace simple
{
internal class Program
{
static void Main(string[] args)
{
Console.WriteLine("\n Name: - Akshit Jindal");
Console.WriteLine("\n Roll No: - 231103046");
}
}
}
OUTPUT:-
PAGE NO. 2
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace arithemtic
{
internal class Program
{
static void Main(string[] args)
{
int a, b, add, mul, sub, div, mod;
Console.WriteLine("\n Name: - Akshit Jindal");
Console.WriteLine("\n Roll No: - 231103046");
Console.Write("\n Enter the value of a = ");
a=Convert.ToInt32(Console.ReadLine());
Console.Write("\n Enter the value of b = ");
b=Convert.ToInt32(Console.ReadLine());
add=a+b;
mul = a * b;
sub = a - b;
div = a / b;
mod = a % b;
Console.WriteLine("\n Addition = "+add);
Console.WriteLine("\n Subtraction = "+sub);
Console.WriteLine("\n Multiplication = "+mul);
Console.WriteLine("\n Division = "+div);
Console.WriteLine("\n Modulus = "+mod);
}
}
}
OUTPUT:-
PAGE NO. 3
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace relationalop
{
internal class Program
{
static void Main(string[] args)
{
Console.WriteLine("\n Name:-Akshit Jindal");
Console.WriteLine("\n Roll no:- 231103046");
int a, b;
Console.Write("\n Enter the value of a = ");
a=Convert.ToInt32(Console.ReadLine());
Console.Write("\n Enter the value of b = ");
b=Convert.ToInt32(Console.ReadLine());
Console.WriteLine("\n A < B (a is smaller then b) = " + (a < b));
Console.WriteLine("\n A > B (a is greater then b) = " + (a > b));
Console.WriteLine("\n A >= B (a is greater then equal to b) = " + (a >= b));
Console.WriteLine("\n A <= B (a is less then equal to b) = " + (a <= b));
Console.WriteLine("\n A == B (a is equal to b) = " + (a == b));
Console.WriteLine("\n A != B (a is not equal to b)= " + (a != b));
}
}
}
OUTPUT:-
PAGE NO. 4
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace cosnstructor
{
class React
{
double length, breath, area;
public React(double a,double b)
{
length = a;
breath = b;
area = length * breath;
}
public void display()
{
Console.WriteLine("\n Length = " + length);
Console.WriteLine("\n Breath = " + breath);
Console.WriteLine("\n Area of reactangle = " + area);
}
}
internal class Program
{
static void Main(string[] args)
{
Console.WriteLine("\n Name: - Akshit Jindal");
Console.WriteLine("\n Roll No: - 231103046");
React re = new React(20.20, 3.26);
re.display();
}
}
}
OUTPUT:-
PAGE NO. 5
using System;
using System.Collections.Generic;
using System.Dynamic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace inheritance
{
class A
{
public void show()
{
Console.WriteLine("\n Base class");
}
}
class B : A
{
public void getdata()
{
Console.WriteLine("\n Derived class");
}
}
internal class Program
{
static void Main(string[] args)
{
Console.WriteLine("\n Name: - Akshit Jindal");
Console.WriteLine("\n Roll No: - 231103046");
B ob= new B();
ob.getdata();
ob.show();
}
}
}
OUTPUT:-
PAGE NO. 6
Design View:-
OUTPUT:-
PAGE NO. 7
Design View:-
OUTPUT:-
PAGE NO. 8
Design View:-
PAGE NO. 9
Source Code:-
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
}
protected void Button1_Click(object sender, EventArgs e)
{
if (lbl_dan.Checked == true)
lbl_show.Text = "Dancing";
if (lbl_sin.Checked== true)
lbl_show.Text =lbl_show.Text+","+ "Singing";
if (lbl_ball.Checked== true)
lbl_show.Text = lbl_show.Text + "," + "FootBall";
if (lbl_read.Checked== true)
lbl_show.Text = lbl_show.Text + "," + "Reading";
if (lbl_o.Checked== true)
lbl_show.Text = lbl_show.Text + "," + "Others";
}
}
OUTPUT:-
PAGE NO. 10
Source Code:-
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
namespace Form_file
{
public partial class WebForm1 :System.Web.UI.Page
{
Source Code:-
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
namespace newform
{
public partial class WebForm1 :System.Web.UI.Page
{
Source Code:-
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
}
protected void Button1_Click(object sender, EventArgs e)
{
show.Text = "--- Preview ---";
stname_txt.Text = "Student Name : - " + st_txt.Text;
ph_txt.Text = "Phone No. : - " + phn_txt.Text;
}
}
OUTPUT:-
PAGE NO. 19
Source Code:-
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
}
protected void Button1_Click(object sender, EventArgs e)
{
show.Text = "--- Preview ---";
stname.Text = "Student Name : - " + stname_txt.Text;
age.Text = "Age : - " + age_txt.Text;
}
}
OUTPUT:-
PAGE NO. 21
Source Code:-
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
}
protected void Button1_Click(object sender, EventArgs e)
{
show.Text = "--- Preview ---";
stname.Text = "Student Name : - " + stname_txt.Text;
show_pass.Text = "Password : - " + pass_txt.Text;
}
}
OUTPUT:-
PAGE NO. 23
Source Code: -
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
}
protected void Button1_Click(object sender, EventArgs e)
{
show.Text = "Submitted...";
show_email.Text = "Email ID : - " + email_txt.Text;
show_pass.Text = "Password : - " + pass_txt.Text;
}
}
OUTPUT:-
PAGE NO. 25
Source Code: -
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
}
protected void Button1_Click(object sender, EventArgs e)
{
show.Text = "Submitted...";
show_email.Text = "Email ID : - " + email_txt.Text;
show_pass.Text = "Password : - " + pass_txt.Text;
}
}
OUTPUT:-
PAGE NO. 27
Design View:-
PAGE NO. 28
Source Code: -
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
}
protected void LinkButton1_Click(object sender, EventArgs e)
{
show_user.Text = "User ID: - " + user_txt.Text;
show_pass.Text = "Password: - " + pass_txt.Text;
}
}
OUTPUT:-
PAGE NO. 29
Source Code: -
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
}
protected void Button1_Click(object sender, EventArgs e)
{
show_city.Text = "City Name : " + City_list.Text;
}
protected void DropDownList1_SelectedIndexChanged(object sender,
EventArgs e)
{
}
}
OUTPUT:-
PAGE NO. 31
Source Code: -
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
}
protected void Button1_Click(object sender, EventArgs e)
{
show_course.Text = "Selected Course : " + course.Text;
}
}
OUTPUT:-
PAGE NO. 33
Source Code: -
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
}
}
OUTPUT:-
PAGE NO. 37
Design View: -
PAGE NO. 38
Source Code: -
Design View: -
PAGE NO. 40
Source Code: -
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
{
namespace WebApplication5
{
public partial class WebForm1 :System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{