You are on page 1of 15

2408237

EXPERIMENT-1

AIM:- Make an Application To Perform Arithmetic operations.

CODING:-
using System;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;

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


{
void Button1_Click(object sender, EventArgs e)
{
TextBox3.Text=Convert.ToString(Convert.ToInt32(TextBox1.Text) +
Convert.ToInt32(TextBox2.Text));
}

protected void Button2_Click(object sender, EventArgs e)


{
TextBox6.Text = Convert.ToString(Convert.ToInt32(TextBox4.Text) –
Convert.ToInt32(TextBox5.Text));
}

protected void Button3_Click(object sender, EventArgs e)


{
TextBox9.Text = Convert.ToString(Convert.ToInt32(TextBox7.Text) *
Convert.ToInt32(TextBox8.Text));
}

protected void Button4_Click(object sender, EventArgs e)


{
TextBox12.Text = Convert.ToString(Convert.ToInt32(TextBox10.Text) /
Convert.ToInt32(TextBox11.Text));
}
}
2408237

OUTPUT:-

 
2408237

EXPERIMENT- 2

AIM:- Make an application to print Date Time & Images with various
Controls.

CODING:-
using System;

using System.Configuration;

using System.Data;

using System.Linq;

using System.Web;

using System.Web.Security;

using System.Web.UI;

using System.Web.UI.HtmlControls;

using System.Web.UI.WebControls;

using System.Web.UI.WebControls.WebParts;

using System.Xml.Linq;

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


{

protected void Page_Load(object sender, EventArgs e)

Label1.Text = DateTime.Now.ToString();

Image1.ImageUrl = "1.jpg";

protected void Button1_Click(object sender, EventArgs e)


{

Image2.ImageUrl = "2.jpg";

Image3.ImageUrl = "3.jpg";
}
}
2408237

OUTPUT:-

                                                                                                                                                             
                                                                     
2408237
2408237

EXPERIMENT- 3
AIM:- Make an Program to upload a file using file upload control.

CODING:-

using System;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;

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


{

protected void Button1_Click(object sender, EventArgs e)

{
if (FileUpload1.HasFile)

FileUpload1.SaveAs("D:/FILE/" + FileUpload1.FileName);

Label1.Text = "FILE UPLOADED SUCESSFULLY";

else

Label1.Text = "NO FILE UPLOADED";

}
2408237

OUTPUT:-
2408237
2408237

EXPERIMENT-4
AIM :- Make a Program with the help of Radio button ,Checkbox and
Dropdownlist.

CODING:-

using System;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;

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


{

protected void Button1_Click(object sender, EventArgs e)


{
Label1.Text = TextBox1.Text;
Label2.Text= RadioButtonList1.SelectedValue;
Label3.Text = CheckBoxList1.SelectedValue.ToString();
Label4.Text = DropDownList1.SelectedValue;
}
}
2408237

OUTPUT:-
2408237

EXPERIMENT-5
AIM:- Make a Program with Validation controls.

CODING:-
using System;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;

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


{

protected void Button1_Click(object sender, EventArgs e)


{
if (Page.IsValid == true)
Label7.Text = "YOUR ACCOUNT IS OPENED SUCESSFULLY";
else
Label7.Text = "ENTERED INFORMATION IS WRONG";

}
}
2408237

OUTPUT: -
2408237
2408237

EXPERIMENT – 6

AIM:- Write a program to show selected date from a calender into a


text box using button click.

CODING:-

using System;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;

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


{
protected void Page_Load(object sender, EventArgs e)
{

}
protected void TextBox1_TextChanged(object sender, EventArgs e)
{

}
protected void Button1_Click(object sender, EventArgs e)
{
TextBox1.Text = Calendar1.SelectedDate.ToString();
}
}
2408237

OUTPUT:-

You might also like