ASPX : Active Server Pages Extension Ascx: web user control Asax : global.asax. used to run apllication and state events nCW A WL8 ALICA1ICN WCkkS? AnS
LkLAIN ADVAN1ASLS CI ASNL1 d|ff b]w asp and aspnet AnS ASP.NET is not limited to script languages, it allows you to make use of .NET languages like C#, J#, VB, etc. t allows developers to build very compelling applications by making use of Visual Studio, the development tool provided by Microsoft. ASP.NET is purely server-side technology. t is built on a common language runtime that can be used on any Windows server to host powerful ASP.NET web sites and technologies.
ln aspneL code behlnd and hLml code are menLalned dlfferenL erformance of appllcaLlon hlgh becoz code behlnd wlll execuLe only whenever requlred buL ln hLml lL loads 1 sL before run
Non-MS Platform Support
Classical ASP had no mechanism of running itself on non- Microsoft technology platforms like the 'The Apache Web Server'
But, ASP.NET ASP.NET could be run on non-Microsoft Platforms also. Cassini is a sample Web server produced by Microsoft which, among other projects, has been used to host ASP.NET with Apache.
Multi Language Support in WebPage
In ASP only two languages were available for scripting VBScript and Jscript/Javascript. But in ASP.NET We are no longer constrained to the two scripting languages available in traditional ASP: Any fully compliant .NET language can now be used with ASP.NET, including C# and VB.NET.
Note :- (C# and VB.Net are both server Side languages.)
Validation & Browser scripting capabilities O ASP has no inbuilt facility for Validation of controls.i.e, checking whether a textbox is left blank or not or a combo is selected or not or if a phone number does not fit a particular pattern for a area and many such examples. O The user had to write the client side Javascript code for all these kind of validations. O Client and server side validation both were the headache of the of the developer. O Javascript code to fit a particular Browser was also the developer's burden. He had to write specific code so that it could fit a set of browsers. It took lot of the developers time. But in ASP.NET, In built validation controls are provided which are as easy to implement and the developer has to worry the least. The features provided by ASP.NET validation controls is :- O Browser Independent coding :- Developer does not have to worry about the browser how the controls would render to. O Client-Side or Server-Side :- The Validation Controls manage the code checking if the client side code is disabled the validation is done on the server side.
#ich Validation set :- There are 6 types of validation which cater to the needs of the validation requirements: O #equiredFieldValidation Control - #equires that the control not be left blank. O CompareValidator Control - Used to compare Data in Two Controls O #angeValidator Control - Used to check for #ange validation.(also supports various data Type - Date , string etc..) O #egularExpressionValidator Control - Used to check the complicated patterns in the user input. O CustomValidator Control- The final control we have included in ASP.NET is one that adds great flexibility to our validation abilities. We have a custom validator where we get to write out own functions and pass the control value to this function. This control also provides Client side and server side validation of which the Server side validation could be a different function altogether. O Validation Summary - The validation summary control will collect all the error messages of all the non-valid controls and put them in a tidy list. The list can be either shown on the web page (as shown in the example above) or with a popup box
CAS(CCDL ACCLSS SLCUkI1)
.NET has two kinds of security: 1. #ole Based Security 2. Code Access Security #ole Based Security What it is... Role-based security allows you to partition your web site according to the "role" of the user. That means that once a user is logged-in, the determination as to whether or not access to a resource is granted is based on the roles a user plays--such as "administrator", or "premium subscriber", or "guest", for example. Why you shouId use it... t is much more flexible and powerful than simply using basic authentication, whereby any user that can "log in" has access to your entire site -- unless you specify users in a config file, which can be very tedious and not very maintainable. Using roles, changing the config file for the purpose of changing security settings occurs less often. or this purpose forms authentication. Code Access Security ode access securlLy (AS) ls a securlLy mechanlsm by whlch Lhe common language runLlme () of Lhe nL1 framework can resLrlcL Lhe managed code Lo execuLe operaLlons wlLh a llmlLed seL of permlsslons as ls a parL of doLneL securlLy model LhaL deLermalns wheLher a plece of code ls allowed Lo run and whaL resources lL can use whlle runnlng Lx cas wlll allow an appllcaLlon Lo read buL noL Lo wrlLe and deleLe a flle or resource from a folder exp|a|ne about assemb||es and namespaces?
An assembly ls a blnary flle LhaL conLalns nL1 execuLable code complled lnLo MSl assembly ls a unlL of deployemenL llke dll or exe
namespace A namespace ls a collecLlon of classes lLs more used for loglcal organlzaLlon of your classes
3 Lypes of assemblles
1prlvaLe assembly prlvaLe assembly ls normally used by a slngle appllcaLlon and ls sLored ln Lhe appllcaLlon dlrecLory or a sub dlrecLory Lhere ls no verslon consLralnL ln Lhls
2publlc assembly(shared assembly) a shared assembly ls normally sLored ln CA(globel assembly cache) lL has verslon consLralnL CA ls reposlLlry of shared assemblles malnLalned by Lhe neL runLlme lL ls locaLed aL cwlndowsassembly shared assembly can be used by many appllcaLlons 1o make an assembly shared assembly lL musL have sLrong name
3saLLellLe assembly lL ls an assembly LhaL conLalns only resources and no code Lhe resources are locaLlon speclflc a saLLellLe assembly ls assoclaLed wlLh maln assembly LhaL one acLually conLalns Lhe code saLelllLe assemblles are used Lo bulld mulLlllnguesLlc appllcaLlons appllcaLlon whlch has bullL ln supporLlve of more Lhan one human readable language ls known as mulLlllngusLlc appllcaLlons " ExpIain GIobaI AssembIy Cache.
lobal Assembly Cache is the place holder for shared assembly. f an assembly is installed to the lobal Assembly Cache, the assembly can be accessed by multiple applications. n order to install an assembly to the AC, the assembly must have to be signed with strong name.
" Explain the components of web form in ASPET
Server controls. The server controls are Hypertext Markup Language (HTML) elements that include a runat=server attribute. They provide automatic state management and server-side events and respond to the user events by executing event handler on the server.
HTML controls. These controls also respond to the user events but the events processing happen on the client machine.
Data controls Data controls allow to connect to the database, execute command and retrieve data from database.
System components System components provide access to system-level events that occur on the server.
". Define VirtuaI foIder.
t is the folder that contains web applications. The folder that has been published as virtual folder by S can only contain web applications.
":State Management
State management is the process by which you maintain state and page information over multiple requests for the same or different pages.
Types of State Management
There are 2 types State Management:
1 Client - Side State Management This stores information on the client's computer by embedding the information into a Web page, a uniform resource locator(url), or a cookie. The techniques available to store the state information at the client end are listed down below:
a. View State - Asp.Net uses View State to track the values in the Controls. You can add custom values to the view state. It is used by the Asp.net page framework to automatically save the values of the page and of each control just prior to rendering to the page. When the page is posted, one of the first tasks performed by page processing is to restore view state.
b. Control State - If you create a custom control that requires view state to work properly, you should use control state to ensure other developers dont break your control by disabling view state.
c. Hidden fields - Like view state, hidden fields store data in an HTML form without displaying it in the user's browser. The data is available only when the form is processed.
d. Cookies - Cookies store a value in the user's browser that the browser sends with every page request to the same server. Cookies are the best way to store state data that must be available for multiple Web pages on a web site.
e. Query Strings - Query strings store values in the U#L that are visible to the user. Use query strings when you want a user to be able to e-mail or instant message state data with a U#L.
2 Server - Side State Management a. Application State - Application State information is available to all pages, regardless of which user requests a page.
b. Session State - Session State information is available to all pages opened by a user during a single visit.
Both application state and session state information is lost when the application restarts. To persist user data between application restarts, you can store it using profile properties.
". ExpIain the difference between Server controI and HTML controI.
Server events Server control events are handled in the server whereas HTML control events are handled in the page. State management Server controls can maintain data across requests using view state whereas HTML controls have no such mechanism to store data between requests. Browser detection Server controls can detect browser automatically and adapt display of control accordingly whereas HTML controls can't detect browser automatically. Properties Server controls contain properties whereas HTML controls have attributes only.
". What are the vaIidation controIs avaiIabIe in ASP.NET?
ASP.NET validation controls are:
CompareValidator: This allows checking if data of one control match with other control. RangeValidator: This verifies if entered data is between two values. RequiredFieldValidator: This validates controls if controls contain data. RegularExpressionValidator: This checks if entered data matches a specific format. CustomValidator: Validate the data entered using a client-side script or a server-side code. ValidationSummary: This allows developer to display errors in one place.
". Define caching.
Caching enables you to store the expensive data into Cache object and later retrieve it without doing expensive operations.
" How to turn off cookies for a page?
Cookie.Discard Property when true, instructs the client application not to save the Cookie on the user.s hard disk when a session ends.
". How can you ensure a permanent cookie? Setting Expires property to MinValue and restrict cookie to get expired.
". What is AutoPostback? AutoPostBack automatically posts the page back to the server when state of the control is changed.
". What is the use of Web.config fiIe?
Following are the setting you can incorporate in web.config file. Database connections Error Page setting Session States Error Handling Security Trace setting Culture specific setting