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
[ResponsiveRect]
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:
- Radio Button, List Item
- Attributes.Add()
Output:
Program:
[LinkVer]
// 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)
{
}
}
[LinkVer]
// 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>