Beruflich Dokumente
Kultur Dokumente
using
using
using
using
using
using
System;
System.Collections.Generic;
System.Linq;
System.Web;
System.Web.UI;
System.Web.UI.WebControls;
namespace ASP.NETPROGRAMS
{
public partial class FirstPrgrm : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
}
protected void btnclick_Click(object sender, EventArgs e)
{
lblmsg.Text = "Welcome to " + txtfirstname.Text +
txtlastname.Text;
}
}
}
Program 2:
using
using
using
using
using
using
System;
System.Collections.Generic;
System.Linq;
System.Web;
System.Web.UI;
System.Web.UI.WebControls;
namespace ASP.NETPROGRAMS
{
public partial class SecondPrgrm : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
}
protected void btnadd_Click(object sender, EventArgs e)
{
int x = int.Parse(txtfirst.Text);
int y = int.Parse(txtsecond.Text);
int z = x + y;
lblmsg.Text = "Addition result is:" + z;
}
protected void btnsub_Click(object sender, EventArgs e)
{
int x = int.Parse(txtfirst.Text);
int y = int.Parse(txtsecond.Text);
int z = x - y;
lblmsg.Text = "Subtraction result is:" + z;
}
protected void btnmul_Click(object sender, EventArgs e)
{
int x = int.Parse(txtfirst.Text);
int y = int.Parse(txtsecond.Text);
int z = x * y;
lblmsg.Text = "Multiplication result is:" + z;
}
protected void btndiv_Click(object sender, EventArgs e)
{
int x = int.Parse(txtfirst.Text);
int y = int.Parse(txtsecond.Text);
int z = x / y;
lblmsg.Text = "Division result is:" + z;
}
}
}
Program 3:
using
using
using
using
using
using
System;
System.Collections.Generic;
System.Linq;
System.Web;
System.Web.UI;
System.Web.UI.WebControls;
namespace ASP.NETPROGRAMS
{
public partial class ThirdPrgrm : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
}
protected void Button1_Click(object sender, EventArgs e)
{
int qty = int.Parse(txtqnty.Text);
int cost = int.Parse(txtcost.Text);
int total = qty * cost;
lblmsg.Text = "Total bill is:" + total;
}
}
}
Program 4:
using
using
using
using
using
using
System;
System.Collections.Generic;
System.Linq;
System.Web;
System.Web.UI;
System.Web.UI.WebControls;
namespace ASP.NETPROGRAMS
{
public partial class FourthPrgrm : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
}
protected void Button1_Click(object sender, EventArgs e)
{
int m1 = int.Parse(txtm1.Text);
int m2 = int.Parse(txtm2.Text);
int m3 = int.Parse(txtm3.Text);
int total = m1 + m2 + m3;
int per = total / 3;
lblmsg.Text = "Total is:" + total;
lblper.Text = "Percentage is:" + per+"%";
}
}
}
Program 5:
using
using
using
using
using
using
System;
System.Collections.Generic;
System.Linq;
System.Web;
System.Web.UI;
System.Web.UI.WebControls;
namespace ASP.NETPROGRAMS
{
public partial class FifthPrgrm : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
}
protected void btncalculate_Click(object sender, EventArgs
e)
{
int sal = int.Parse(txtsal.Text);
double da = sal * 0.2;
double hra = sal * 0.4;
double totsal = sal + da + hra;
txtda.Text = da.ToString();
txthra.Text = hra.ToString();
txttotsal.Text = totsal.ToString();
}
}
}
Program 6:
using
using
using
using
using
using
System;
System.Collections.Generic;
System.Linq;
System.Web;
System.Web.UI;
System.Web.UI.WebControls;
{
protected void Page_Load(object sender, EventArgs e)
{
}
protected void btnsubmit_Click(object sender, EventArgs e)
{
if(txtuser.Text=="" && txtpassword.Text=="")
{
lblmsg.Text="UserName & Password must not be empty";
txtuser.Text = "";
txtuser.Focus();
}
else if(txtuser.Text=="")
{
lblmsg.Text = "UserName Must not be Empty";
txtuser.Focus();
}
else if(txtpassword.Text=="")
{
lblmsg.Text = "Password Must not be Empty";
txtpassword.Focus();
}
else
{
if(txtuser.Text==txtpassword.Text)
{
lblmsg.Text = "Welcome to " + txtuser.Text;
}
else
{
lblmsg.Text = "Invalid User";
}
txtuser.Text = "";
txtuser.Focus();
}
}
}
Program 7:
using
using
using
using
using
using
System;
System.Collections.Generic;
System.Linq;
System.Web;
System.Web.UI;
System.Web.UI.WebControls;
lbluser.Text = "";
lblpswrd.Text = "Password Must not be Empty";
}
else if(txtpwrd.Text!=txtcnfrmpswrd.Text)
{
lbluser.Text = "";
lblpswrd.Text = "";
lblcnfrmpswrd.Text = "";
txtpwrd.Focus();
lblcnfrmpswrd.Text = "Password and confirm password
must be same";
}
else if (int.Parse(txtage.Text) <= 18 && int.Parse(txtage.Text)
<= 25)
{
lbluser.Text = "";
lblpswrd.Text = "";
lblcnfrmpswrd.Text = "";
lblage.Text = "Age Must be between 18 to 25";
}
else if(txtpnum.MaxLength>=10)
{
lbluser.Text = "";
lblpswrd.Text = "";
lblcnfrmpswrd.Text = "";
lblage.Text = "";
lblpnum.Text = "Phone Number must not exceed 10
numbers";
}
else
{
lbluser.Text = "";
lblpswrd.Text = "";
lblcnfrmpswrd.Text = "";
lblage.Text = "";
lblpnum.Text = "";
lblmsg.Text = "Sucessfully Registered";
}
}
Program 8:
using
using
using
using
using
using
System;
System.Collections.Generic;
System.Linq;
System.Web;
System.Web.UI;
System.Web.UI.WebControls;
}
lblmsg.Text = "Your qualification is:" +
RadioButtonList1.SelectedValue + " " + "and" + " " + "your
selected course is:" + chk;
}
RadioButtonList1.ClearSelection();
CheckBoxList1.ClearSelection();
}
}
Program 9:
using
using
using
using
using
using
System;
System.Collections.Generic;
System.Linq;
System.Web;
System.Web.UI;
System.Web.UI.WebControls;
using
using
using
using
using
using
System;
System.Collections.Generic;
System.Linq;
System.Web;
System.Web.UI;
System.Web.UI.WebControls;
}
protected void rbndroom_CheckedChanged(object sender,
EventArgs e)
{
lblaminities.Visible = true;
chkac.Visible = true;
chkcomputer.Visible = true;
if (chkac.Checked == false && chkcomputer.Checked ==
false)
{
lblmsg.Text = "Please select Aminities";
}
}
}
Program11:
using
using
using
using
using
using
System;
System.Collections.Generic;
System.Linq;
System.Web;
System.Web.UI;
System.Web.UI.WebControls;
using
using
using
using
using
using
System;
System.Collections.Generic;
System.Linq;
System.Web;
System.Web.UI;
System.Web.UI.WebControls;
{
if (TextBox1.Text == "")
{
Response.Write("Please enter BookName");
}
else
{
DropDownList1.Items.Add(TextBox1.Text);
TextBox1.Text = "";
TextBox1.Focus();
}
}
}
Program 13:
using
using
using
using
using
using
System;
System.Collections.Generic;
System.Linq;
System.Web;
System.Web.UI;
System.Web.UI.WebControls;
break;
}
}
txtresult.Text = total.ToString();
}
}
}
Program 14:
using
using
using
using
using
using
System;
System.Collections.Generic;
System.Linq;
System.Web;
System.Web.UI;
System.Web.UI.WebControls;
Program 15:
using
using
using
using
using
using
System;
System.Collections.Generic;
System.Linq;
System.Web;
System.Web.UI;
System.Web.UI.WebControls;
Program 16:
using
using
using
using
using
using
System;
System.Collections.Generic;
System.Linq;
System.Web;
System.Web.UI;
System.Web.UI.WebControls;
Program 17:
using
using
using
using
using
using
System;
System.Collections.Generic;
System.Linq;
System.Web;
System.Web.UI;
System.Web.UI.WebControls;
Program 18:
using
using
using
using
using
using
System;
System.Collections.Generic;
System.Linq;
System.Web;
System.Web.UI;
System.Web.UI.WebControls;
case "*":
lblmsg.Text += (a * b).ToString();
break;
case "/":
lblmsg.Text += (a / b).ToString();
break;
case "%":
lblmsg.Text += (a % b).ToString();
break;
}
}
}
Program 19:
using
using
using
using
using
using
System;
System.Collections.Generic;
System.Linq;
System.Web;
System.Web.UI;
System.Web.UI.WebControls;
int b = int.Parse(txt2.Text);
if (drplst1.SelectedValue == "less")
{
if (a < b)
{
lblmsg.Text = "A is Less Than B";
}
else
{
lblmsg.Text = "A is not Less Than B";
}
}
else if (drplst1.SelectedValue == "greater")
{
if (a > b)
{
lblmsg.Text = "A is Greater Than B";
}
else
{
lblmsg.Text = "A is not Greater Than B";
}
}
else if (drplst1.SelectedValue == "lessequal")
{
if (a <= b)
{
lblmsg.Text = "A is LessThan And equal B";
}
else
{
lblmsg.Text = "A is not LessThan or equal B";
}
}
else if (drplst1.SelectedValue == "greaterequal")
{
if (a >= b)
{
Program 20:
using
using
using
using
using
using
System;
System.Collections.Generic;
System.Linq;
System.Web;
System.Web.UI;
System.Web.UI.WebControls;
Program 21:
using
using
using
using
using
using
System;
System.Collections.Generic;
System.Linq;
System.Web;
System.Web.UI;
System.Web.UI.WebControls;
Program 22:
using
using
using
using
using
using
System;
System.Collections.Generic;
System.Linq;
System.Web;
System.Web.UI;
System.Web.UI.WebControls;
Program 23:
using
using
using
using
using
using
System;
System.Collections.Generic;
System.Linq;
System.Web;
System.Web.UI;
System.Web.UI.WebControls;
Program 24:
using
using
using
using
using
using
System;
System.Collections.Generic;
System.Linq;
System.Web;
System.Web.UI;
System.Web.UI.WebControls;
{
lblpass.Text = "";
lbluser.Text = "";
lblmsg.Text = "Login Succuessed";
}
}
}
Program 25:
using
using
using
using
using
using
System;
System.Collections.Generic;
System.Linq;
System.Web;
System.Web.UI;
System.Web.UI.WebControls;
else
{
lblmsg.Text = txtname.Text+ " "+"your age is"+"
"+txtage.Text;
}
}
}
Program 27:
using
using
using
using
using
using
System;
System.Collections.Generic;
System.Linq;
System.Web;
System.Web.UI;
System.Web.UI.WebControls;
int end ;
int units=0;
if(txtend.Text==" " || txtstart.Text=="")
{
lblmsg.Text = "Please enter starting and ending reading
numbers";
}
else
{
start = int.Parse(txtstart.Text);
end = int.Parse(txtend.Text);
units = start - end;
lblmsg.Text = " ";
txtunits.Text = units.ToString();
}
if(rbnlist.SelectedItem.Text=="Industry")
{
units=(units*5);
lbl.Text = "Total Bill is:" + " " + units;
}
else if (rbnlist.SelectedItem.Text=="Commercial")
{
units=(units*4);
lbl.Text = "Total Bill is:" + " " + units;
}
else
{
units = (units * 3);
lbl.Text = "Total Bill is:" + " " + units;
}
}
}
Program 28:
using
using
using
using
using
using
System;
System.Collections.Generic;
System.Linq;
System.Web;
System.Web.UI;
System.Web.UI.WebControls;
{
basicsal = basicsal + basicsal * 0.05;
txtsal.Text = (basicsal).ToString();
}
}
}
Program 29:
using
using
using
using
using
using
System;
System.Collections.Generic;
System.Linq;
System.Web;
System.Web.UI;
System.Web.UI.WebControls;
int m3 = int.Parse(txtm3.Text);
int tot = m1 + m2 + m3;
double result = tot / 3;
txttotal.Text = tot.ToString();
}
protected void btnresult_Click(object sender, EventArgs e)
{
int m1 = int.Parse(txtm1.Text);
int m2 = int.Parse(txtm2.Text);
int m3 = int.Parse(txtm3.Text);
int tot = m1 + m2 + m3;
double result = tot / 3;
txtresult.Text = result.ToString();
}
}
Program 30:
using
using
using
using
using
using
System;
System.Collections.Generic;
System.Linq;
System.Web;
System.Web.UI;
System.Web.UI.WebControls;
}
protected void Button1_Click(object sender, EventArgs e)
{
lblmsg.Text = "";
double current = double.Parse(txtcurrentbal.Text);
double trans = double.Parse(txttrans.Text);
double netbal = 0;
if(RadioButton2.Checked)
{
if(trans>current)
{
lblmsg.Text = "Current Balance is than the transaction
balance";
txtnet.Text = netbal.ToString();
}
else
{
netbal = current - trans;
txtnet.Text = netbal.ToString();
}
}
else
{
netbal = current + trans;
txtnet.Text = netbal.ToString();
}
}
}