Sunday, December 4, 2011

Explain the different parts that constitute ASP.NET application.


Content, program logic and configuration file constitute an ASP.NET application.
Content files
Content files include static text, images and can include elements from database.
Program logic
Program logic files exist as DLL file on the server that responds to the user actions.
Configuration file
Configuration file offers various settings that determine how the application runs on the server.

Explain the advantages of ASP.NET.


Following are the advantages of ASP.NET.
Web application exists in compiled form on the server so the execution speed is faster as
compared to the interpreted scripts.
ASP.NET makes development simpler and easier to maintain with an event-driven, server-side
programming model.
Being part of .Framework, it has access to all the features of .Net Framework.
Content and program logic are separated which reduces the inconveniences of program
maintenance.
ASP.NET makes for easy deployment. There is no need to register components because the
configuration information is built-in.
To develop program logic, a developer can choose to write their code in more than 25 .Net
languages including VB.Net, C#, JScript.Net etc.
Introduction of view state helps in maintaining state of the controls automatically between the
postbacks events.
ASP.NET offers built-in security features through windows authentication or other authentication
methods.
Integrated with ADO.NET.
Built-in caching features.

Explain how a web application works.


A web application resides in the server and serves the client’s requests over internet. The client
access the web page using browser from his machine. When a client makes a request, it receives
the result in the form of HTML which are interpreted and displayed by the browser.
A web application on the server side runs under the management of Microsoft Internet
Information Services (IIS). IIS passes the request received from client to the application. The
application returns the requested result in the form of HTML to IIS, which in turn, sends the result
to the client.

Saturday, September 17, 2011

Parse Integer

public class Test
   public Shared Sub Main
        Try
            Dim num_items As Integer = Integer.Parse("123")
        Catch ex As Exception
            Console.WriteLine(ex.Message)
        End Try
   End Sub
End class

MinValue and MaxValue of Integer

public class Test
   public Shared Sub Main
               Dim iNum As Integer
               Console.WriteLine("Integer: " & iNum.MinValue & " to " & iNum.MaxValue)
   End Sub
End class

Swap two integers without using a third

Imports System.Drawing
Imports System.Drawing.Drawing2D
Imports System.Collections
Public Class Tester
    Public Shared Sub Main
        
        Dim firstValue As Integer
        Dim secondValue As Integer

        firstValue = 17
        secondValue = 123
        Console.WriteLine("Before swap: {0}, {1}",firstValue, secondValue)

        firstValue = firstValue Xor secondValue
        secondValue = firstValue Xor secondValue
        firstValue = firstValue Xor secondValue
        Console.WriteLine("After swap: {0}, {1}",firstValue, secondValue)
    End Sub
End Class

Integer calculation

public class Test
   public Shared Sub Main
        Dim As Integer

        ' try adding numbers...
        n = 16
        n += 10.23
        Console.WriteLine("Addition " & n)

        ' try subtracting numbers...
        n = 24
        n -= 2
        Console.WriteLine("Subtraction " & n)

        ' try multiplying numbers...
        n = 6
        n *= 10
        Console.WriteLine("Multiplication " & n)

        ' try dividing numbers...
        n = 12
        n /= 6
        Console.WriteLine("Division " & n)


   End Sub
End class

Explain the different parts that constitute ASP.NET application.

Content, program logic and configuration file constitute an ASP.NET application. Content files Content files include static text, images ...