Skip to main content

Asp.Net Tutorial Assignment no 5 – 22 Lectures List

Listed the Assignment no 5 for ASP.Net Programming. Learn All New ASP.Net latest 2016 Programs. We are here to Provide all Learning resource related to Computer Softwares. Find More Here

Find Tally Tutorial Here
Find Advance Excel Tutorial Here


Lecture 2

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

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

Must Read: Install Whatsapp with Rooted Andriod Phone

Objective:

Write a program to change Back colour of web form after selecting particular colour from Radio button.

Controls, Methods, Properties & Event Used:

  1. Radio Button, List Item
  2. Attributes.Add()

 

Output:

ASP.NET BG Color Change as Radio Change

Program:

// In Aspx.cs
===============
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 frmCheckBoxRadioExample : System.Web.UI.Page
{
protected void RadioButtonList1_SelectedIndexChanged1(object sender,EventArgs e)
{
body1.Attributes.Add(“bgcolor”, RadioButtonList1.SelectedItem.Text);
}
protected void Page_Load(object sender, EventArgs e)
{
}
}

GenronTech Header-Cartoon

// In Source of .Aspx page
<html xmlns=”http://www.w3.org/1999/xhtml” >
<head runat=”server”>
<title>Radio Button List Example</title>
</head>
<body runat=”server” id=”body1″>
<form id=”form1″ runat=”server”>
<div id=”DIV1″ runat=”server”>
<asp:RadioButtonList ID=”RadioButtonList1″ runat=”server” OnSelectedIndexChanged=”RadioButtonList1_SelectedIndexChanged1″ AutoPostBack=”True”>
<asp:ListItem Value=”Gold”>Silver</asp:ListItem>
<asp:ListItem Value=”Orange”>Gray</asp:ListItem>
</asp:RadioButtonList>
</div>
</form>
</body>
</html>

Leave a Reply

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