3297 - DotNET - Practical 4 - 5
3297 - DotNET - Practical 4 - 5
Experiment 4 & 5
AIM: Create web application using ASP.Net Web Controls and Rich Controls.
Source: WebForm1.aspx
Code:
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
<style type="text/css">
.auto-style1 {
width: 100%;
.auto-style-horizontal {
display: flex;
.auto-style3 {
width: 365px;
padding: 20px;
background-color: lightblue;
.auto-style4{
display: flex;
flex-direction: row;
height: 58px;
.auto-style9 {
margin-left: 0px;
</style>
</head>
<body>
<br />
<table class="auto-style1">
<tr>
<td class="auto-style5">
</td>
<td class="auto-style6">
</td>
</tr>
<tr>
<td class="auto-style7">
</td>
<td class="auto-style8">
</td>
</tr>
<tr>
</tr>
<tr>
<asp:ListItem>Male</asp:ListItem>
<asp:ListItem>Female</asp:ListItem>
</asp:RadioButtonList>
</td
</tr>
<tr>
</tr>
<tr>
<td colspan="2">
<asp:ListItem>Computer</asp:ListItem>
<asp:ListItem>Management</asp:ListItem>
<asp:ListItem>PHARMACY</asp:ListItem>
</asp:CheckBoxList>
</td>
</tr>
<tr>
</tr>
<tr>
<td>
<asp:ListItem>India</asp:ListItem>
<asp:ListItem>China</asp:ListItem>
<asp:ListItem>USA</asp:ListItem>
<asp:ListItem>France</asp:ListItem>
<asp:ListItem>Canada</asp:ListItem>
<asp:ListItem>Burundi</asp:ListItem>
</asp:DropDownList>
</td>
</tr>
<tr>
</td>
</tr>
<tr>
</td>
</tr>
</table>
</form>
</body>
</html>
{
public partial class WebForm1 : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
}
protected void Submit_Form(object sender, EventArgs e)
{
}
}
Label3.Text = "<b>Your Full name is </b>" + TextBox1.Text + " " + TextBox2.Text +
"</br>" +
"<b>Your Gender is</b>: " + RadioButtonList1.SelectedValue + "</br><b>Selected
Courses </b>: "+ selectedValue
+ "</br><b>Your Country is: </b>" +DropDownList1.SelectedItem.Value;
}
Output:
Source: default.aspx
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
</head>
<body>
<div>
Rich
Controls
<br />
<br />
Calendar
</div>
<br />
Upload a File
<br />
<br />
<br />
<br />
Ad Rotator
<br />
<br />
<br />
<br />
MultiView Control
<br />
<br />
<div>
The morning sun filtered through the thick canopy of trees, casting
dappled shadows on the forest floor. Birds chirped harmoniously, creating a serene melody
that blended with the soft rustle of leaves in the gentle breeze. As the path meandered
through the woods, the scent of pine and damp earth filled the air, evoking a sense of
tranquility. Every step on the moss-covered trail was cushioned, as if the forest itself
welcomed each visitor with open arms. It was a place where time seemed to slow down,
allowing one to truly connect with the rhythm of nature.
</div>
</asp:View>
<div>
<div>
<div class="pt-0">
</svg>
</div>
</div>
</div>
</div>
</div>
<hr />
<hr />
</div>
</div>
</asp:View>
<div>
<div class="pt-0">
</div>
</div>
</div>
</div>
</div>
<hr />
<hr />
<hr />
</div>
</div>
</div>
</div>
</div>
</asp:View>
</asp:MultiView>
</form>
<p> </p>
<p> </p>
</body>
</html>
Source: default.aspx.cs
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
namespace prac_5
MultiView1.ActiveViewIndex = 1;
} }
Source: default.aspx.cs
<Advertisements>
<style>
.ad-rotator img {
</style>
<Ad>
<ImageUrl>~/Images/ad1.jpg</ImageUrl>
<NavigateUrl>http://www.example1.com</NavigateUrl>
<AlternateText>Ad 1</AlternateText>
<Impressions>50</Impressions>
</Ad>
<Ad>
<ImageUrl>~/Images/Ad2.jpeg</ImageUrl>
<NavigateUrl>http://www.example2.com</NavigateUrl>
<AlternateText>Ad 2</AlternateText>
<Impressions>50</Impressions>
</Ad>
<Ad>
<ImageUrl>~/Images/ad3.jpeg</ImageUrl>
<NavigateUrl>http://www.example3.com</NavigateUrl>
<AlternateText>Ad 3</AlternateText>
<Impressions>50</Impressions>
</Ad>
<Ad>
<ImageUrl>~/Images/a1.jpg</ImageUrl>
<NavigateUrl>http://www.example1.com</NavigateUrl>
<AlternateText>Ad 1</AlternateText>
<Impressions>50</Impressions>
</Ad>
<Ad>
<ImageUrl>~/Images/a2.jpg</ImageUrl>
<NavigateUrl>http://www.example1.com</NavigateUrl>
<AlternateText>Ad 1</AlternateText>
<Impressions>50</Impressions>
</Ad>
<Ad>
<ImageUrl>~/Images/a3.jpg</ImageUrl>
<NavigateUrl>http://www.example1.com</NavigateUrl>
<AlternateText>Ad 1</AlternateText>
<Impressions>50</Impressions>
</Ad>
</Advertisements>
Output: