Project Source Code
Project Source Code
Project Source Code
UI – User Interface
.NET Introduction
ASP.NET
SQL Server
ADO.NET
HTML
HTML5 is the latest and most enhanced version of HTML. This introduces a
number of new elements and attributes that helps in building a modern website.
<!DOCTYPE html>
<html>
<head>
<title> </title>
<style> </style>
<script> </script>
</head>
<body>
<form> </form>
</body>
</html>
Example
<!DOCTYPE html>
<html>
<html lang="en-US">
<head>
<title>My Project</title>
<script
src="https://maxcdn.bootstrapcdn.com/bootstrap/4.1.0/js/bootstrap.min.js"></sc
ript>
<script
src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<script
src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.0/umd/popper.min.js"
></script>
-->
<style>
body {background-color: powderblue;}
</style>
<h1>H1</h1>
<h2 style="color:yellow;">H2</h2>
<h3 style="font-family:verdana;">H3</h3>
<h3>My <span style="color:green">Important</span> Heading</h3>
<h4 style="font-size:100%;">H4</h4>
<h4 style="background-color:orange">H4</h4>
<h5 style="background-color:rgb(0,0,255)">H5</h5>
<h6 style="background-color:#00FF00">H6</h6>
<a href="http://www.google.com">Google</a>
<a href="http://www.microsoft.com/" target="_blank">Visit Microsoft</a>
<a href="Home2/Index"><img src="/Images/Penguins.jpg" alt="HTML"
style="width:42px;height:42px;border:0"></a>
Table
<style>
table, th, td {
border: 1px solid black;
border-collapse: collapse;
}
</style>
<table style="width:100%">
<tr>
<th>Firstname</th>
<th>Lastname</th>
<th>Age</th>
</tr>
<tr>
<td>Andrew</td>
<td>Bergeran</td>
<td>35</td>
</tr>
<tr>
<td>Amalesh </td>
<td>Bergeran</td>
<td>5</td>
</tr>
</table>
List
<ul style="list-style-type:square">
<ul>
<li>Coffee</li>
<li>Tea</li>
<li>Milk</li>
</ul>
</ul>
Div Tag and Class
<style>
.city {
float: left;
margin: 5px;
padding: 15px;
max-width: 300px;
height: 100px;
border: 1px solid black;
}
</style>
<div class="city">
<p>The user interface (UI), is the design field in human and computer
interaction.</p>
</div>
Form
<!--<form action="action_page.asp" method="get">
URL Display Like => action_page.php?firstname=Mickey&lastname=Mouse
<form>
First name:<br>
<input type="text" name="firstname" value="Mickey">
<br>
Last name:<br>
<input type="text" name="lastname" value="Mouse">
<br>
<input type="submit" value="Submit" />
<select name="DotNET">
<option value="C#">C#</option>
<option value="MVC">MVC</option>
<option value="ADO.NET">ADO.NET</option>
<option value="SQl">SQL</option>
</select>
</form>
</body>
</html>
CSS - stands for Cascading Style Sheets
CSS is a language that describes the style of an HTML document and CSS
describes how HTML elements should be displayed. It used to control the style
of a web document in a simple and easy way.
CSS describes how HTML elements are to be displayed on screen. It saves a lot
of work. It can control the layout of multiple web pages all at once.
Syntax
Selector {Declaration}
P { color:clue} property and Value
Inline Style
<!DOCTYPE html>
<html>
<head>
<title>Page Title</title>
<style>
</style>
</head>
<body style="background-color:Gray;">
<h1 style="color:Blue; text-align:center">H1</h1>
<p style ="font-family:Calibri; font-size:20px;">My Test Paragraph</p>
</body>
</html>
<body>
<h1>Header1</h1>
<p>My Test Paragraph</p>
</body>
</html>
External Style Sheet
Mystyle.css
h1
{
font-family:Calibri;
font-style:normal;
font-size:large;
color:White;
text-align:center;
position:absolute;
width:500px;
height:800px;
border:3px medium red;
}
body
{
/*background-clip:padding-box;*/
background-position:center;
background-color:Highlight;
}
<!DOCTYPE html>
<html>
<head>
<title>Page Title</title>
<link rel="stylesheet" type="text/css" href="~/Content/mystyle.css">
</head>
<body>
<h1>Header1</h1>
<p>My Test Paragraph</p>
</body>
</html>
Element Selector, ID Selector and Class Selector
<!DOCTYPE html>
<html>
<head>
<style>
p{
text-align: center; color:Fuchsia;
border: 1px solid powderblue; padding: 30px;
}
</style>
</head>
<body>
<h1>CSS</h1>
<p>Every paragraph will be affected</p>
<p id="myname">A.Andrew Bergeran</p>
<p class ="anytext">Networks and C#.NET</p>
</body>
</html>
JavaScript
<!DOCTYPE html>
<html>
<body>
<p id="demo1"></p>
<script>
var x, y, z;
x = 5;
y = 5;
z = x + y;
document.getElementById("demo1").innerHTML = z;
function myFunction()
{
document.getElementById("demo2").innerHTML = "Hello JavaScript!";
}
</script>
</body>
</html>
<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="width=device-width" />
<title>Index</title>
<script language="javascript" type="text/javascript">
function f1()
{
var x, y, z;
x = document.getElementById("A").value;
y = document.getElementById("B").value;
z = parseInt(x) + parseInt(y);
document.getElementById("C").value = z;
}
function f2()
{
alert("Hello")
}
</script>
</head>
<body>
<input type="text" id="A" />
<input type="text" id="B" />
<input type="button" onclick="f1()" value="Calc " />
<!--<input type="text" id="C" /> -->
<input type="button" onclick="f2()" value="Msg" />
</body>
</html>
JQuery
jQuery is a fast, small, and feature-rich JavaScript library. It makes things like
HTML document traversal and manipulation, event handling, animation, and
Ajax much simpler with an easy-to-use API that works across a multitude of
browsers.
Layout.cshtml
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width" />
<title>@ViewBag.Title</title>
@Styles.Render("~/Content/css")
@Scripts.Render("~/bundles/modernizr")
</head>
<body>
@RenderBody()
@Scripts.Render("~/bundles/jquery")
@Scripts.Render("~/bundles/jqueryui")
@Styles.Render("~/Content/themes/css", "~/Content/css")
@RenderSection("scripts", required: false)
</body>
</html>
Index.cshtml
<script>
$(document).ready(function ()
{
$("p").click(function ()
{
$(this).hide();
});
$("#amal").click(function ()
{
$(this).hide(); alert("viki")
});
$(".andrew").click(function ()
{
$(this).hide();
});
$(".bergeran").click(function ()
{
var x = 1;
var y = 1;
var c = x + y;
alert(c);
document.getElementById("val").innerHTML = c;
});
});
</script>
<script>
$(document).ready(function ()
{
$('#datepicker').datepicker();
});
</script>
AutoComplete
<script>
$(function ()
{
var availableTags = [
"ActionScript",
"AppleScript",
"Asp",
"BASIC",
"C",
"C++",
"Clojure",
"COBOL",
"ColdFusion",
"Erlang",
"Fortran",
"Groovy",
"Haskell",
"Java",
"JavaScript",
"Lisp",
"Perl",
"PHP",
"Python",
"Ruby",
"Scala",
"Scheme"
];
$("#tags").autocomplete({ source: availableTags });
});
</script>
@{
ViewBag.Title = "Index";
}
<h2>Index</h2>
@section Scripts {
[HttpPost]
[ActionName("Index")]
public ActionResult Post_Index()
{
//string na = "Andrew";
string na = Request["sname"];
IQueryable<Register> q = from s in db.Registers where s.Sname == na
select s;
List<Register> list1 = new List<Register>();
foreach (var i in q)
{
list1.Add(i);
}
ViewBag.na = na;
return View(list1);
}
<h2>Index</h2>
@section Scripts {
<div id="Div1"></div>
Bootstrap
Bootstrap is the most popular HTML,CSS, and JavaScript framework for
developing responsive, mobile-first web sites.
<!DOCTYPE html>
<html lang="en">
<head>
<base href="C:/UI/CSS" target="_blank">
<title>Bootstrap Example</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="bootstrap.min.css">
<script src="jquery.min.js"></script>
<script src="bootstrap.min.js"></script>
</head>
<body>
<iframe width="100%" height="100%" src="G:/UI/CSS/menu.html"></iframe>
<div class="container">
<div class="row">
<div class="col-sm-4">
<h3>Column 1</h3>
<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit...</p>
</div>
<div class="col-sm-4">
<h3>Column 2</h3>
<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit...</p>
</div>
<div class="col-sm-4">
<h3>Column 3</h3>
<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit...</p>
</div>
</div>
</div>
<html lang="en">
<head>
<base href="C:/UI/CSS/" target="_blank">
<title></title>
<link href="cm-style.css" rel="stylesheet" type="text/css">
<link href="bootstrap.css" rel="stylesheet" type="text/css" />
<link href="bootstrap.min.css" rel="stylesheet" type="text/css" />
<!-- Collect the nav links, forms, and other content for toggling -->
<div class="collapse navbar-collapse " id="bs-example-navbar-collapse">
<ul class="nav navbar-nav">
<li style="border-right:0px solid silver;"> </span>
<a href="#">Home</a></li>
<li style="border-right:0px solid silver;"><a href="#">About Us</a></li>
<li class="dropdown" style="border-right:0px solid silver;" >
<a href="#" class="dropdown-toggle"data-toggle="dropdown">Technology
<span class="caret"></span>
</a>
</li>
<li class="dropdown" style="border-right:0px solid silver;">
<a href="#" class="dropdown-toggle"
data-toggle="dropdown">Services <span class="caret"></span></a>
<ul class="dropdown-menu" role="menu">
<li><a href="#">Banking</a></li>
<li><a href="#">Hospitality</a></li>
<li><a href="#">Education</a></li>
<li><a href="#">Government</a></li>
<li><a href="#">Travels</a></li>
<li><a href="#">Other Services</a></li>
</ul>
</li>
</asp:Panel>
</form>
</body>
</html>
JSON
JSON is syntax for storing and exchanging data. JSON is text, written with
JavaScript object notation.
JSON
<!DOCTYPE html>
<html>
<body>
<h2> Create Object from JSON String</h2>
<p id="demo"> </p>
<script>
var text = '{"employees":[' +
'{"firstName":"John","lastName":"Doe" },' +
'{"firstName":"Anna","lastName":"Smith" },' +
'{"firstName":"Peter","lastName":"Jones" }]}';
obj = JSON.parse(text);
document.getElementById("demo").innerHTML =
obj.employees[2].firstName + " " + obj.employees[1].lastName;
</script>
</body>
</html>
Json using .JS Files
<!DOCTYPE html>
<html>
<body>
<div id="id01"> </div>
<script>
function myFunction(arr)
{
var out = "";
var i;
for (i = 0; i < arr.length; i++)
{
out += '<a href="' + arr[i].url + '">' + arr[i].display + '</a><br>';
}
document.getElementById("id01").innerHTML = out;
}
</script>
<script src="mydata.js"></script>
</body>
</html>
Mydata.js
myFunction
([
{
"display": "India ",
"url": "http://www.India.com/js/default.asp"
},
{
"display": "Digital India",
"url": "http://www.google.com/html/default.asp"
},
{
"display": "Tamil",
"url": "http://www.tamilnadu.gov "
}
]);
Microsoft Visual Studio .NET
Introduction
IDE such as Visual Basic .NET, Visual C++, Visual C# .NET, Visual J# .NET all use
the same integrated development environment (IDE), Visual Studio .NET is a
complete set of development tools for Software Applications.
Microsoft created the .NET Framework using OOPs, these concepts helps to
design and develops better software components.
Features:
Language Interoperability
Language Independence
There are Two Main Components in .NET Framework.
1.0 .Net
Code that runs under the control of the common language runtime (CLR) is
known as managed code Such as C#,VB.NET, and other .NET Supported
Languages
Code that does not run under the CLR is known as native code. (VB6, C, C++,
COM). In both native code together with managed code for all platforms
supported by Microsoft Windows, Windows Mobile, Windows CE,
Intermediate Language (IL)
CLS is a document that says how computer programs can be turned into byte
code. When several languages use the same byte code, different parts of a
program can be written in different languages. Microsoft uses a Common
Language Specification for their .NET Framework.
CTS is a standard that specifies how Type definitions and specific values of
Types are represented in computer memory. It is intended to allow programs
written in different programming languages to easily share information.
Base Class Library (BCL) – .NET Framework Components and COM (Common
Object Models) BCL is a Common Language Infrastructure (CLI) standard
library available to all CLI languages. large number of common functions, such
as file reading and writing, graphic rendering, database interaction, and
XML document manipulation, which makes the programmer's job easier.
Namespaces: Namespaces are heavily used in C# language. .NET Framework
uses namespaces to organize its many classes
using System.IO ;
using System.Data.SqlClient;
using System.Windows.Forms;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
Project - Language
• Visual Basic
• Visual C#
• Visual J#
• Visual C++
• Setup and Deployment
Applications
C# Programming Language
Simple Multithreading
• Namespace declaration
• Class Name
• Class methods
• Class attributes
• A Main method
• Statements & Expressions
• Comments
Note:
• C# is case-sensitive
• All statements and expression must end with a semicolon (;).
• The program execution starts at the Main method.
// Single Line Comment
/ * */ Multiline Comment
Create a New Project
Program Location
ASP.NET
ASP.NET is a Server-Side Web Application Framework that you can create
dynamic web pages. It was developed by Microsoft to allow programmers to
build dynamic web sites, web applications and web services.
Html and Design View Code Inline and Code Behind Html and Design View
XML Not in-built Support XML Support for easy data Exchange Partially Support XML