Asp.Net Tutorial Assignment no 4 – 22 Lectures List

ASP.net Assignment and Tutorial for beginners. Learn properly All ASP.Net Programs and Code to build an Attractive Website for Industries. Find All 22 lectures List for Learning ASP.Net Programming. Feel Free to Comment Bellow for any Difficulty.

[ResponsiveRect]

Lecture 2

Asp.Net Programming Assignment no 4 – ASP Tutorial for Beginners

Objective:

Write a program to display message after selecting colour as per Check Box list.

Controls, Methods, Properties & Event Used:

  1. Check Box, Label & Button
  2. Response.Write()

Output:

ASP.Net Assignment no 4 Tutorial

Program:

[LinkVer]

using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
public partial class frmCheckBoxExample : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
}
protected void btnSubmit_Click(object sender, EventArgs e)
{
lbMsg.Text = “Ok! your favourite color is/are “;
string color = “”;
if (ckBlue.Checked)
{
// Response.Write(“<font color=’blue’>Blue</font>”);
lbMsg.Text += “<font color=’blue’> Blue </font>”;
color += ” Blue “;
}
if (ckRed.Checked)
{
//Response.Write(“<font color=’red’>Red</font>”);
lbMsg.Text += “<font color=’red’> Red </font>”;
color += ” Red “;
}
Response.Write(“<script>alert(‘your favourite color is/are” + color + “‘)</script>”);
}
}

Must Read : How To Spy on Girlfriend / Boyfriend Whatsapp Account

Must Read: Install Whatsapp with Rooted Andriod Phone

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top