.Net Introduction Part 2

 

Dynamic webpage: 

The interactive webpage is called as “dynamic webpage”. Dynamic webpage creation requires 2 things. 

1.user interfaces [html controls] 

2.scripting

 

Html is providing “input tag” for creating user interfaces. 

Syntax: 

<input type =”text [default] button…” 

Name/id =”…”..> 

èType will specify which type of user interface to be created 

èName id will specify unique identification to a control

EX: 

<input type=”button…> ->browser will create button control. 

<input type=”text”…> ->browser will create textbox control. 

The programming with in webpage is called “scripting”, This can be classified into two types 

1.client side scripting 

2.server side scripting

 

Client side scripting: The logic executed by browser is called “client side scripting”. This can be used to perform basic validations (or) accessing client system resources [like printer,…] it will reduce burden on webserver. Java script is recommended for client side scripting, it is supported by all the browsers. Java script is provided by sunmicro.java script is case sensitive. Java script is loosely typed language, variables can be used without declaration and datatypes are not supported.

 

Syntax to place javascript into webpage

<html> 

<head> 

<script language =”java script”> 

Function functionname() 

{….} 

…. 

</script> 

</head> 

<body>

 

Creating user interfaces to call javascript functions 

</body> 

</html>

 

Creating dynamic webpage

Go to notepad 

<html> 

<head> 

<script> 

Function f1() 

{
    window.print () 

</script> 

</head> 

<body> 

<input type= “button” id=”b1” value=”print” onclick=”f1()” > 

<br> 

<h1> asp.net 4.0 features </h1> 

<h2> 

·         Session shrinking <br> 

·         Chart control <br> 

·         url routing… 

</h2> 

</body> 

</html>

 

Save as print.html [e:\aspnet 131] 

Goto browser e:/aspnet 131/print.html you will get the output.

 

Note

1.window.print method can be used to display print dialogbox 

2.on click will maintain address of javascript function, This java script function will be executed when user clicks on button

 

Requirement: 

           Web page 

          New batches 

 

*ASpnet 11.15-1.15

*c#         1.30-3.00

 

 

 

**                                                    scrolling-[marque] up direction

 

                                           

 

 

 

Width

 

Marquee is providing following methods

1.start() 

   It will start scrolling text 

2.stop() 

      It will stop scrolling text 

Example

Goto note pad 

<html>

 

<head>

 

<script>

 

function f1()

 

{ m1.start ()}

 

Function f2()

 

{m1.stop()}

 

</script>

 

</head>

 

<body>

 

<font size= “6” color=”red”>

 

New batches

 

</font>

 

<br>

 

<marquee id= “m1” direction=”up” scrollamount= “3” height=”150” width=”170” bgcolor=”orange”

 

   Onmouse over =”f2()”

 

   Onmouse out=”f1()”>

 

<h12>

 

*asp.net 11:15-1:15 <br>

 

*C# 1.30-3.00 <br>

 

*php 7.30-9.00<br>

 

</h2>

 

</marquee>

 

</body>

 

</html>

 

Save as courses.html 

Goto browser e:/aspnet 131/courses.html to view output.

 

Note

1.on mouse over will maintain address of javascript function, This will be executed when mouse pointer is taken onto marquee tag information. 

2.on mouse out will maintain address of javascript function, This will be executed when mouse pointer is leaving marquee tag.  

 

C#.Net 4.0

About DLL files: it contains reusable code. These DLL files, we can develop in visual 6.0, As well as in visual studio.Net. 

What is DLL, as per visual studio 6.0 

1)as per visual studio 6.0, The DLL are called as COM components 

2)COM contains the reusable code in the format MACHINE LANGUAGE 

3)every COM component must be registered for a class ID 

4)class ID is the part of registry 

5)as registry is the part of operating system, Hence Visual studio 6.0 DLLs are platform dependents

 

What is DLL as per Visual studio.net (VC#.Net, VB.Net) 

As per.Net a DLL file contains the reusable code in the format of Bytecode. As per .Net a DLL file is called as an assembly. A collection of classes is called as a namespaces. A collection of namespaces is called as an assembly. A collection of assemblies is called as FCL(Frame work class Library] or BCL(base class library). 

 

Managed code & un managed code 

1)that code, which targets CLR is called as managed code. 

2)that code, which takes help of operating system while execution is called as unmanaged code.

3)managed code is faster in execution.