Tuesday, 20 March 2012

*Illustrate and briefly discuss the asp.net page life cycle

*Illustrate and briefly discuss the asp.net page life cycle
 =>When an ASP.NET page runs, the page goes through a life cycle in which it performs a series of processing steps. These include initialization, instantiating controls, restoring and maintaining state, running event handler code, and rendering. It is important for you to understand the page life cycle so that you can write code at the appropriate life-cycle stage for the effect you intend. Additionally, if you develop custom controls, you must be familiar with the page life cycle in order to correctly initialize controls, populate control properties with view-state data, and run any control behavior code. (The life cycle of a control is based on the page life cycle, but the page raises more events for a control than are available for an ASP.NET page alone.)

General Page Life-cycle Stages

In general terms, the page goes through the stages outlined in the following table. In addition to the page life-cycle stages, there are application stages that occur before and after a request but are not specific to a page. 

=>Page request-The page request occurs before the page life cycle begins. When the page is requested by a user, ASP.NET determines whether the page needs to be parsed and compiled (therefore beginning the life of a page), or whether a cached version of the page can be sent in response without running the page.

=>Start-In the start step, page properties such as Request and Response are set. At this stage, the page also determines whether the request is a postback or a new request and sets the IsPostBack property. Additionally, during the start step, the page's UICulture property is set.

=>Page initialization-During page initialization, controls on the page are available and each control's UniqueID property is set. Any themes are also applied to the page. If the current request is a postback, the postback data has not yet been loaded and control property values have not been restored to the values from view state.

=>Load-During load, if the current request is a postback, control properties are loaded with information recovered from view state and control state.

=>Validation-During validation, the Validate method of all validator controls is called, which sets the IsValid property of individual validator controls and of the page.

=>Postback event handling-If the request is a postback, any event handlers are called.

=>Rendering-Before rendering, view state is saved for the page and all controls. During the rendering phase, the page calls the Render method for each control, providing a text writer that writes its output to the OutputStream of the page's Response property.

=>Unload-Unload is called after the page has been fully rendered, sent to the client, and is ready to be discarded. At this point, page properties such as Response and Request are unloaded and any cleanup is performed. 


*Discuss the ff securing the ASP.NET website

*Discuss the ff securing the ASP.NET website
=>Form-based security is used to implement customized logic for authenticating users without having to worry about session management using cookie. It gives developer more access to specify which files on the site can be accessed and by whom, and allows identification of a login page. This mechanism will automatically redirect the unauthenticated user to login page and ask them to provide proper credentials (e.g. username/password combination). If login is successful, ASP.NET then issues the cookie to the user and redirect them to specific resources that they originally requested. This cookie allows the user to revisit particular protected resources without having to repeatedly log in.
=>Roles it is  interface prompts the user to select a role from a drop-down list and then displays the set of users that belong to that role in a GridView.
=>Themes is a collection of property settings that allow you to define the look of pages and controls, and then apply the look consistently across pages in a Web application, across an entire Web application, or across all Web applications on a server. 
=> Skin has the file name extension .skin and contains property settings for individual controls such as Button, Label, TextBox, or Calendar controls. Control skin settings are like the control markup itself, but contain only the properties you want to set as part of the theme. For example, the following is a control skin for a Button control.
example:
<asp:button runat="server" BackColor="lightblue" ForeColor="black" />
 
There are two types of control skins, default skins and named skins:

=>A default skin automatically applies to all controls of the same type when a theme is applied to a page. A control skin is a default skin if it does not have a SkinID attribute. For example, if you create a default skin for a Calendar control, the control skin applies to all Calendar controls on pages that use the theme. (Default skins are matched exactly by control type, so that a Button control skin applies to all Button controls, but not to LinkButton controls or to controls that derive from the Button object.)

=>A named skin is a control skin with a SkinID property set. Named skins do not automatically apply to controls by type. Instead, you explicitly apply a named skin to a control by setting the control's SkinID property. Creating named skins allows you to set different skins for different instances of the same control in an application.
 
          
 

*Enumerate and Give the description and function the control under Standard control and validation control.

*Enumerate and Give the description and function the control under Standard control and validation control.
=>under Standard control

>Texbox-is an input control that lets the user enter the text.
>Label-use to display text in a set location on the page.
>Button-it is a submit button while you are submitting the information you want to submit.

Wednesday, 14 March 2012

* Differentiate the ff/ Give Example.

* Differentiate the ff/ Give Example.
1.if..then VS if...then....else statement VS if...then...else if
=>The if-then statement is the most basic of all the control flow statements. It tells your program to execute a certain section of code only if a particular test evaluates to true.
Ex.... 
If TextBox1.Text = "Hello World!" Then 'Checks if "Hello World!" is written in the textbox.
ListBox1.Items.Add("Hello") 'If "Hello World!" is written then it enters "Hello" into the listbox.
End If 'Ends the If statement.

=>The if...then....else statement It tells your program to execute a certain section of code only if a particular test evaluates Must evaluate to True or False, or to a data type that is implicitly convertible to Boolean.
Ex....
If condition [ Then ]
    [ statements ]
[ ElseIf elseifcondition [ Then ]
    [ elseifstatements ] ]
[ Else
    [ elsestatements ] ]
End If

' Single-line syntax:
If condition Then [ statements ] [ Else [ elsestatements ] ]
=> The If...Then...Else...if statement selection structure allows 
the programmer to specify that a different action is to be performed when the 
condition is True than when the condition is False. 
Ex..... 
If <condition > Then
statements
Else
statements
End If
e.g.: If average>50 Then
txtGrade.Text = "Pass"
Else
txtGrade.Text = "Fail"
End If

2. Object To Attribute To Behavior
=> An object is a software bundle of variables and related methods. it Is Also objects are key to understanding object-oriented technology. You can look around you now and see many examples of real-world objects: your dog, your desk, your television set, your bicycle. 
=>An Attributes are a mechanism for adding metadata, such as compiler instructions and other data about your data, methods, and classes, to the program itself. Attributes are inserted into the metadata and are visible through ILDasm and other metadata-reading tools. Attributes can be used to identify or use the data at runtime execution using .NET Reflection
=>The behavior to be exhibited by class instances at program run time is defined in methods. A method is a subroutine (function) with a special property that it has access to data stored in an object (instance) and is thereby able to control the state of the object. (Note: Some languages allow direct access to instance variables (C++)). The various kinds of methods and language support for them differs. Kinds of methods include regular methods that are created and called by programmer code and special methods (constructors, destructors, conversion operators, static methods, e.g.) that are created and called by compiler-generated code. A language may allow the programmer to define, and even call, special methods.

3. Techniques in OOP
-Data Abstraction Vs Encapsulation
=>Data Abstraction is the process of recognizing and focusing on important characteristics of a situation or object and leaving/filtering out the un-wanted characteristics of that situation or object.Lets take a person as example and see how that person is abstracted in various situations.
=>Encapsulation is an attribute of object design. It means that all of the object's data is contained and hidden in the object and access to it restricted to members of that class. 
- Inheritance VS Polymorphism 
=> Inheritance a suggests an object is able to inherit characteristics from another object. In more concrete terms, an object is able to pass on its state and behaviors to its children. For inheritance to work the objects need to have characteristics in common with each other. 
=> Polymorphism n the context of object-oriented programming, is the ability to create a variable, a function, or an object that has more than one form. The word derives from the Greek "πολυμορφισμός" meaning "having multiple forms". In principle, polymorphism can however arise in other computing contexts and it shares important similarities to the concept of degeneracy in biology. 
4. Class VS Method
=>Class is a construct that is used as a blueprint to create instances of itself – referred to as class instances, class objects, instance objects or simply objects. A class defines constituent members which enable these class instances to have state and behavior. Data field members (member variables or instance variables) enable a class object to maintain state. Other kinds of members, especially methods enable a class object's behavior. Class instances are of the type of the associated class.
=>Methods is a subroutine (or procedure or function) associated with a class. Methods define the behavior to be exhibited by instances of the associated class at program run time. Methods have the special property that at runtime, they have access to data stored in an instance of the class (or class instance or class object or object) they are associated with and are thereby able to control the state of the instance.The association between class and method is called binding. A method associated with a class is said to be bound to the class. Methods can be bound to a class at compile time (static binding) or to an object at runtime (dynamic binding).
5. ASP.Net Control
- Standard Control To Validation Control
=>Standard Control enables you to render standard element such as buttons, input filed like textbox,labels etc....
=> Validation Control enables you to validate form data before you submit the data to the server.
  

*Comprehensively Elucidate/Explain the ff.

*Comprehensively Elucidate/Explain the ff.
1. Variables
=>Variables can represent numeric values, characters, character strings, or memory addresses.
Variables play an important role in computer programming because they enable programmers to write flexible programs. Rather than entering data directly into a program, a programmer can use variables to represent the data. Then, when the program is executed, the variables are replaced with real data. This makes it possible for the same program to process different sets of data.
2. Control Structure
=>A control structure is a block of programming that analyzes variables and chooses a direction in which to go based on given parameters. The term flow control details the direction the program takes (which way program control "flows"). Hence it is the basic decision-making process in computing; flow control determines how a computer will respond when given certain conditions and parameters.
3. OOP
=>Object-oriented programming (OOP) is a programming language model organized around "objects" rather than "actions" and data rather than logic. Historically, a program has been viewed as a logical procedure that takes input data, processes it, and produces output data.
4. Web-Based Programming
=>It is programming language is a systematic method to describe computations. Programming languages are most commonly used to describe an intended computation in a form that will allow it to be performed by an electronic computer. Programming languages exist because other forms of human expression such as natural languages are not well-suited to describing computation in sufficient detail to be performed reliably by an electronic computer.

5. ASP.Net Control
=>The ASP.NET AJAX Control Toolkit is an open-source project built on top of the Microsoft ASP.NET AJAX frameworkIt is a joint effort between Microsoft and the ASP.NET AJAX community that provides a powerful infrastructure to write reusable, customizable and extensible ASP.NET AJAX extenders and controls, as well as a rich array of controls that can be used out of the box to create an interactive Web experience. Itcontains more than 30 controls that enable you to easily create rich, interactive web pages.
6.SQL Data Source
=>establishes a live two-way connection between FileMaker Pro and top SQL data sources.
If you do not want a live connection, but wish to import or exchange data with a SQL data source, use the ODBC/JDBC features.
7.ASPX Function
=>A function is basically performs a given action from the script that has access to it, via includes, code insertions, or other methods. Rather than repeatedly rewrite the same block of code to, say, check if the current user is logged into your site, you can put the code into what is essentially a code wrapper and then call it at your convenience with a simple function call.

What is VB.Net?

*What is VB.Net?
=>Visual Basic .NET (VB.NET or VB .NET) is a version of Microsoft's Visual Basic that was designed, as part of the company's .NET product group, to make Web services applications easier to develop. According to Microsoft, VB .NET was reengineered, rather than released as VB 6.0 with added features, to facilitate making fundamental changes to the language. VB.NET is the first fully object-oriented programming (OOP) version of Visual Basic, and as such, supports OOP concepts such as abstraction, inheritance, polymorphism, and aggregation.

What is ASPX?

What is ASPX?
=>ASPX or Active server page extender, is a program that works with web files that are generated on the interment. It is the first code which your web browser recognizes and transforms into and HTML format.