Practical 5 Examples Adv - Web Progr.
Practical 5 Examples Adv - Web Progr.
page.
Practical-1:Create Web Form to demonstrate use of Website Navigation
controls and Site Map.
using System.Diagnostics;
using System.Windows.Forms;
Namespace WindowsFormsApplication13
{
public partial class Form1 : Form
{
Public Form1()
{
InitializeComponent();
}
Output:-
Colusion:- This program is running successful.
using System;
using System.Data;
using System.Data.SqlClient;
using System.Configuration;
After add namespaces write the following code in code behind
Output:-
Conclusion:- This program is running successful.
Practical-2:Create a web application to demonstrate use of Master Page with
applying Styles and Themes for page beautification
Example-1: Design a Web Form and apply the different styles using CSS.
Source code:-
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<style>
.LabelGrey
{
font-weight: bold;
color: darkgray;
}
.LabelBlue
{
font-weight: normal;
color: darkblue;
}
.ClassJoined
{
font-weight: normal;
font-size: 50px;
color: darkcyan;
}
</style>
<title></title>
</head>
<body>
<form id="form1" runat="server">
<div>
<asp:Label ID="lblMessage" runat="server" Font-Size="25px"
Text="Hello, CSharpCorner Users" CssClass="LabelBlue"></asp:Label>
<br />
<asp:Button ID="btnChangeCSS" runat="server" Text="Change
CSS Class" OnClick="btnChangeCSS_Click" />
<br />
<br />
<asp:Label ID="lblWithoutStyle" runat="server" Text="Text
without any style" />
<br />
<asp:Button ID="btnChangeStyle" runat="server"
Text="Change Style on Click" OnClick="btnChangeStyle_Click" />
<br />
<br />
<asp:Label ID="lblWithoutClass" runat="server" Text="Text
without any default class" />
<br />
<asp:Button ID="btnWithoutClass" runat="server"
Text="Class Attached on Click" OnClick="btnWithoutClass_Click" />
</div>
</form>
</body>
</html>
Code Behind .cs File
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
}
protected void btnChangeCSS_Click(object sender, EventArgs e)
{
lblMessage.CssClass = "LabelGrey";
}
protected void btnChangeStyle_Click(object sender, EventArgs e)
{
lblWithoutStyle.Text = "Text with Style";
lblWithoutStyle.Style.Add("font-size", "50px");
}
Output:-
Conclusion:- This program is running successful.
Example-2: Navigate the Web form from one page to theanother by Clicking
on the ImageButton control.
Source code:-
<%@ Page Language="C#" AutoEventWireup="True" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head>
<title>ImageButton Sample</title>
<script language="C#" runat="server">
</script>
</head>
<body>
<h3>ImageButton Sample</h3>
Click anywhere on the image.<br /><br />
</form>
</body>
</html>
Output:-
Source code:-
<head runat="server">
<title>
Untitled Page
</title>
</head>
<body>
<form id="form1" runat="server">
<div>
<tr>
<td style="width: 209px">
<asp:Label ID="lblstr" runat="server" Text="Enter a String"
style="width:94px">
</asp:Label>
</td>
<tr>
<td style="width: 209px"> </td>
<td style="width: 317px"> </td>
</tr>
<tr>
<td style="width: 209px">
<asp:Button ID="btnnrm" runat="server"
Text="No action button" style="width:128px" />
</td>
<tr>
<td style="width: 209px">
<asp:Label ID="lblsession" runat="server" style="width:231px" >
</asp:Label>
</td>
<tr>
<td style="width: 209px">
<asp:Label ID="lblshstr" runat="server">
</asp:Label>
</td>
</table>
</div>
</form>
</body>
</html>
Output:-
Conclusion:- This program is running successful.
{
public async Task SendAsync(IdentityMessage message)
{
await configSendGridasync(message);
}