Professional Documents
Culture Documents
HTML
<html>
<head>
<title>HTML Tutorial</title>
<meta charset="windows-1252">
<meta name="Keywords" content="HTML,CSS,XML,JavaScript,DOM,jQuery,ASP.NET " />
<meta name="Description" content="Free HTML CSS JavaScript" />
<link rel="stylesheet" type="text/css" href="/stdtheme.css">
<script type="text/javascript" src="filepath/filename.js"></script>
<script type="text/javascript">
function displayElement()
{
document.getElementById("err_url").value=addr;
document.getElementById("err_form").style.display="block";
document.getElementById("err_desc").focus();
hideSent();
}
</script>
</head>
<body>
<form id=frmLogin action=login.aspx method=post>
<h1>My First Heading</h1>
<table>
<tr><td>Test1</td><td>Test2</td></tr>
<tr><td>Test1</td><td>Test2</td></tr>
</table>
</form>
</body>
</html>
CSS
body
{
background-color:#d0e4fe;
}
h1
{
color:orange;
text-align:center;
}
p
{
font-family:"Times New Roman";
font-size:20px;
}
#para1
{
text-align:center;
color:red;
}
.center {text-align:center;}
InLine Styles
<p style="color:sienna;margin-left:20px">This is a paragraph.</p>
body {background-color:#b0c4de;}
body {background-image:url('paper.gif');}
body
{
background-image:url('gradient2.png');
background-repeat:repeat-x;
}
body
{
background-image:url('img_tree.png');
background-repeat:no-repeat;
}
TextAlignment
p.main {text-align:justify;}
h3 {text-decoration:underline;} //Decoration
p.uppercase {text-transform:uppercase;} //Transformation
h1 {font-size:40px;}
h2 {font-size:30px;}
p {font-size:14px;}
table, th, td
{
border: 1px solid black;
}
td
{
text-align:right;
}
table, td, th
{
border:1px solid green;
}
th
{
background-color:green;
color:white;
}
XML
XML stands for eXtensible Markup Language.
<?xml version="1.0"?>
<note>
<to>Tove</to>
<from>Jani</from>
<heading>Reminder</heading>
<body>Don't forget me this weekend!</body>
</note>
XML was designed to transport and store data.
HTML was designed to display data.
<root>
<child>
<subchild>.....</subchild>
</child>
</root>
<bookstore>
<book category="COOKING">
<title lang="en">Everyday Italian</title>
<author>Giada De Laurentiis</author>
<year>2005</year>
<price>30.00</price>
</book>
<book category="CHILDREN">
<title lang="en">Harry Potter</title>
<author>J K. Rowling</author>
<year>2005</year>
<price>29.99</price>
</book>
<book category="WEB">
<title lang="en">Learning XML</title>
<author>Erik T. Ray</author>
<year>2003</year>
<price>39.95</price>
</book>
</bookstore>
Names cannot start with the letters xml (or XML, or Xml, etc)
Javascript
Scripting Language. All HTML page use javascript to add functionality to pages
<!DOCTYPE html>
<html>
<head>
<script>
function displayDate()
{
document.getElementById("demo").innerHTML=Date();
}
</script>
</head>
<body>
</body>
</html>
DataTypes are String, Number, Boolean, Array, Object, Null, Undefined, but all defined using
var keyword
Function Syntax
function myFunction(name,job)
{
alert("Welcome " + name + ", the " + job);
}
function myFunction()
{
var x=5;
return x;
}
variable scope
String Functions
charAt() Returns the character at the specified index
concat() Joins two or more strings, and returns a copy of the joined strings
fromCharCode() Converts Unicode values to characters
indexOf() Returns the position of the first found occurrence of a specified value in a string
lastIndexOf() Returns the position of the last found occurrence of a specified value in a string
replace() Searches for a match between a substring (or regular expression) and a string, and
replaces the matched substring with a new substring
split() Splits a string into an array of substrings
substr() Extracts the characters from a string, beginning at a specified start position, and
through the specified number of character
substring() Extracts the characters from a string, between two specified indices
toLowerCase() Converts a string to lowercase letters
toUpperCase() Converts a string to uppercase letters
isNaN()
parseInt()
eval()
Control statements
if( myVariable == 2 ) { //If
myVariable = 1;
} else {
myVariable = 0;
}
do { //do-while
myArray[myVariable] = 1;
myVariable++;
} while
switch(myVar) { //switch
case 1:
//if myVar is 1 this is executed
case 'sample':
//if myVar is 'sample' (or 1, see the next paragraph)
//this is executed
case false:
//if myVar is false (or 1 or 'sample', see the next paragraph)
//this is executed
default:
//if myVar does not satisfy any case, (or if it is
//1 or 'sample' or false, see the next paragraph)
//this is executed
}
try {
//do something that might cause an error
} catch( myError ) {
//if an error occurs, this code will be run
//two properties will (by default) be available on the
//object passed to the statement
alert( myError.name + ': ' + myError.message );
} finally {
//optional - this code will always be run before the
//control structure ends, even if you rethrow the error
//in the catch
}
JS Validations
function validate()
{
DHTML
Interactive website
Toggle display of Div or elements based on events like onclick, hover, onmouseup,
onmousedown, onmouseover, onmouseout, etc
WebProgramming
Web Concept
Client/Server
The clientserver model is a distributed application structure in computing that partitions tasks
or workloads between the providers of a resource or service, called servers, and service
requesters, called clients.[1] Often clients and servers communicate over a computer network
on separate hardware, but both client and server may reside in the same system. A server is a
host that is running one or more server programs which share their resources with clients. A
client does not share any of its resources, but requests a server's content or service function.
Clients therefore initiate communication sessions with servers which await incoming requests.
IIS
Application Pool, Virtual Directory, Self SSL, Error Pages, ASP.NET CGI restrictions,
Authentication, iisreset, logs.
The Common Language Runtime (CLR) is the virtual machine component of Microsoft's .NET
framework and is responsible for managing the execution of .NET programs. In a process
known as Just-in-time compilation, the compiled code is converted into machine instructions
that, in turn, are executed by the computer's CPU. The CLR provides additional services
including memory management, type safety and exception handling. All programs written for
the .NET framework, regardless of programming language, are executed by the CLR. It
provides exception handling, garbage collection and thread management. CLR is common to
all versions of the .NET framework.
The CLR is Microsoft's implementation of the Common Language Infrastructure (CLI) standard.
Websites webservices
Response.Buffer=true/false
Response.Flush
Response.Expires = -1 //page never cached, mins specified
Response.Write
Response.Redirect
Response.Clear
Response.End
Response.BinaryWrite
Server.scripttimeout in seconds
Server.CreateObject
Server.Execute
Server.HTMLEncode
Server.MapPath
Server.Transfer
Server.URLEncode
Application.Lock
Application.Unlock
Application[Object_Name]
Application onstart, onend
Session.SessionID
Session.Timeout in mins
Session.Abandon
Session[Session_Object_Name]
Session onStart, onEnd
Response.Redirect: tells the browser that the requested page can be found at a new location.
The browser then initiates another request to the new page loading its contents in the
browser. This results in two requests by the browser.
Server.Transfer: It transfers execution from the first page to the second page on the server. As
far as the browser client is concerned, it made one request and the initial page is the one
responding with content. The benefit of this approach is one less round trip to the server from
the client browser. Also, any posted form variables and query string parameters are available
to the second page as well.
Web.config/machine.config
<configuration>
<configSections>
<sectionGroup>
</sectionGroup>
</configSections>
<system.web>
</system.web>
<connectionStrings>
</connectionStrings>
<appSettings>
</appSettings>
</configuration>
<?xml version="1.0"?>
<!-- Web.Config Configuration File -->
<configuration>
<system.web>
<customErrors mode="Off"/>
</system.web>
</configuration>
<compilation debug="true" strict="false" explicit="true" />
<pages enableViewStateMac="true" enableEventValidation="true"
viewStateEncryptionMode="Always">
<namespaces>
<clear />
<add namespace="System" />
<add namespace="System.Collections" />
</namespaces>
<controls>
<add src ="~/controls/ctl.ascx" tagPrefix ="mycontrol" tagName ="ctl1"/>
</controls>
</pages>
</system.web>
</configuration>
Anynymous-Windows->Digest->Basic
www.w3schools.com
http://www.codeproject.com/Articles/98950/ASP-NET-authentication-and-authorization