My Profile

Friday, January 28, 2011

HTML & Its Structure

HTML is used for designing static web pages. It is hierarchical language and every instruction is provided in tha form of tags.


The only advantage of HTML is it takes very less code to provide good design/output. Its structure is divided into 2 parts.



  • <Head>
  • <Body>
Head part is used to provide information and some instructions related to current page.

The presentation part is written in Body part. one important tag in presentation is <Form> tag.

Use of <Form> tag: 

To create any graphical element in HTML, we have to use form element because HTML provides them as form elements. Another use of form tag is to send the content from client to server. We use form and its controls for communication.

Example:  Button, TextBox, CheckBox etc.,

Let's see one example program.

<html>
  <head>
      <title>Demo Program</title>
 </head>
 <body>
      <h1>Welcome</h1>
      <form id="form">
          UserName : <input type="text" id="t1"/><br/>
          Email Id : <input type="text" id="t2"/><br/>
          <input type="button" id="button1" value="Submit"/>
     </form>
  </body>
</html>

The output for this will be like this:





----------------------------------------------------------

** If you like this post please like our page in facebook "Dot Net Support

CSS Syntax



A CSS rule has two main parts: a selector, and one or more declarations:


The selector is normally the HTML element you want to style.

Each declaration consists of a property and a value.
The property is the style attribute you want to change. Each property has a value.


CSS Example

CSS declarations always ends with a semicolon, and declaration groups are surrounded by curly brackets:

         p {color:red;text-align:center}

To make the CSS more readable, you can put one declaration on each line, like this:

Example

p
{
color:red;
text-align:center;
}

------------------------------------------------------

** If you like this post please like our page in facebook "Dot Net Support



CSS Demo


An HTML document can be displayed with different styles:

Styles Solved a Big Problem

HTML was never intended to contain tags for formatting a document.
HTML was intended to define the content of a document, like:

<h1>This is a heading</h1>
<p>This is a paragraph.</p>

When tags like <font>, and color attributes were added to the HTML 3.2 specification, it started a nightmare for web developers. Development of large web sites, where fonts and color information were added to every single page, became a long and expensive process.

To solve this problem, the World Wide Web Consortium (W3C) created CSS.

In HTML 4.0, all formatting could be removed from the HTML document, and stored in a separate CSS file.
All browsers support CSS today.

CSS Saves a Lot of Work!

CSS defines HOW HTML elements are to be displayed.
Styles are normally saved in external .css files. External style sheets enable you to change the appearance and layout of all the pages in a Web site, just by editing one single file!


------------------------------------------------------

** If you like this post please like our page in facebook "Dot Net Support

Introduction to CSS


CSS Tutorial

Save a lot of work with CSS!
In our CSS tutorial you will learn how to use CSS to control the style and layout of multiple Web pages all at once.



CSS Example
body
{
background-color:#d0e4fe;
}
h1
{
color:orange;
text-align:center;
}
p
{
font-family:"Times New Roman";
font-size:20px;
}

<html>

<head>

<style type="text/css">

body

{

background-color:#d0e4fe;

}

h1

{

color:orange;

text-align:center;

}

p

{

font-family:"Times New Roman";

font-size:20px;

}

</style>

</head>

<body>

<h1>CSS example!</h1>

<p>This is a paragraph.</p>

</body>

</html>

What You Should Already Know
Before you continue you should have a basic understanding of the following:
  • HTML / XHTML
If you want to study these subjects first, find the tutorials on our .

What is CSS?
  • CSS stands for Cascading Style Sheets
  • Styles define how to display HTML elements
  • Styles were added to HTML 4.0 to solve a problem
  • External Style Sheets can save a lot of work
  • External Style Sheets are stored in CSS files

----------------------------------------------------------

** If you like this post please like our page in facebook "Dot Net Support

CSS Tutorial

Example Program

Example program for printing sum of two numbers


using System;
class VarsDemo
{
       static void Main()
       {
              int x, y, z;
              Console.Write("Enter x Value :");
              x = int.Parse(Console.ReadLine());
              Console.Write("Enter y Value :");
              y = int.Parse(Console.ReadLine());
              z = x + y;
              Console.WriteLine("sum of {0} & {1} is {2}",x,y,z);              
       }
}




Parse is a method under the types, which can convert the string value into an appropriate type on which the method is called.


Examples:



  • int x = "100";                    //invalid
  • int x = int.Parse("100");    //valid
  • bool b = bool.Parse("true");   //valid
  • float f = float.Parse("3.14f");   //valid

using the parse method on an incompatible value to perform the conversion will give an error

Example:

  • int y = int.Parse("I0A");   //Error

----------------------------------------------------------

** If you like this post please like our page in facebook "Dot Net Support

C# Data Types


  • Integer Types


Note: byte, ushort, uint, ulong can store only unsigned integer values. where as short, int, long, sbyte can store signed values.



  • Float or Decimal Types




  • Boolean Type



  • Character Types


  • Root Type


The size of char type has been increased to 2 bytes providing a support for unicode characters i.e., Multi Language usage support other than english. where the numeric representation of other language character is known as unicode value that requires 2 bytes memory for settle.

String type doesn't have any fixed size because it was a variable length type.

The object type is capable of storing any type of value init and it was also a variable length type.


Syntax for variable declaration:



Examples:

  • int x;
  • string str = "hello";
  • double d1, d2, d3;
  • public bool flag = true;
  • public const float pi = 3.14f; //without "f" it will be treated as decimal and assigning value to const var is mandatory.
  • public readonly int y = 300;



----------------------------------------------------------

** If you like this post please like our page in facebook "Dot Net Support




Thursday, January 27, 2011

Creating website content using VS.Net [HTML,JS & ASP.Net]

Once we create an empty website, we'll get a new project in VS.Net. Entire project can be seen using one important window called "Solution Explorer". IDE means collection of different windows which help user in developing programs. All these windows are available in "View" menu of Visual Studio .Net.


To create an HTML page, we have to goto solution explorer and right click on project and select Add new item option. This action will display list of available templates that we can add to our project.
To begin, select HTML page, provide a name and add it to the project. By default this page will contect automatically, which is commonly required for every page.


All pages we create are displayed in 3 different views:



  • Design View: This view provides WYSIWIG (What You See Is What You Get) view of form. With the help of this view designer, we can design our web page using drag and drop method.
  • Source View: This view displays the html and other markup code that we create for creating a page. It is recommended to work with source view more. So that results are more accurate. This view also supports drag and drop and snippets way of creating context.
  • Split View: Using this view, we can see both design and source view at a time. Also we can work with any view and observe that results are synchronize with other view.

How to run a page from VS .Net?

Once page is designed, we can check it in browser using "start debugging" button provided in toolbar. This button will start the browser and automatically type the URL for us and get the result from server.

Note: If we want to change default browser and temporarily browse with an another browser then we can use

          File --> Browse with.. --> select the required browser.

----------------------------------------------------------

** If you like this post please like our page in facebook "Dot Net Support

Wednesday, January 26, 2011

Creating a website using VS.Net

Steps for Creating a website using VS.Net



  1. Start VS 2010 from programs in administration mode, if we want to work with IIS.
  2. Then goto File --> New --> Website . It is one way to create a website from VS .net.This action will display a window prompting for some inputs.
  • Language : C#
  • Target Framework : .Net 2.0 to .Net 4.0
             This option lets users select the .Net version to be used for executing the current project. Multi targetting .Net framework is one unique feature of .Net which means we can use latest IDE's tools to work with any .Net version and also to change the project from one version to other with simple options.

  • ASP.Net Empty WebSite
           This is what we have to start with as this template doesn't provide any content in project automatically. All the content should be added explicitly by user.

  • Location :
          if we use HTTP, then use IIS for creating a website. for this IIS should be in running state and VS.Net should be in administration mode. with this VS, there is no need to manually goto IIS and create website.


----------------------------------------------------------

** If you like this post please like our page in facebook "Dot Net Support

Share

Twitter Delicious Facebook Digg Stumbleupon Favorites More