What is ASP.Net?
It is a framework developed by Microsoft on which we can develop new generation web sites using web forms(aspx), MVC, HTML, Javascript, CSS etc. Its successor of Microsoft Active Server Pages(ASP). Currently there is ASP.NET 4.0, which is used to develop web sites. There are various page extensions provided by Microsoft that are being used for web site development. Eg: aspx, asmx, ascx, ashx, cs, vb, html, XML etc.
What’s the use of Response.Output.Write()?
We can write formatted output using Response.Output.Write().
In which event of page cycle is the ViewState available?
After the Init() and before the Page_Load().
What is the difference between Server.Transfer and Response.Redirect? 
In Server.Transfer page processing transfers from one page to the other page without making a round-trip back to the client’s browser.  This provides a faster response with a little less overhead on the server.  The clients url history list or current url Server does not update in case of Server.Transfer.
Response.Redirect is used to redirect the user’s browser to another page or site.  It performs trip back to the client where the client’s browser is redirected to the new page.  The user’s browser history list is updated to reflect the new address.
From which base class all Web Forms are inherited?
Page class.
What are the different validators in ASP.NET?
·         Required field Validator
·         Range Validator
·         Compare Validator
·         Custom Validator
·         Regular expression Validator
·         Summary Validator
Which validator control you use if you need to make sure the values in two different controls matched?
Compare Validator control.
What is ViewState?
View State is used to retain the state of server-side objects between page post backs.
Where the view state is stored after the page post back?
View State is stored in a hidden field on the page at client side.  View State is transported to the client and back to the server, and is not stored on the server or any other external source.
How long the items in View State exists?
They exist for the life of the current page.
What are the different Session state management options available in ASP.NET?
1.           In-Process
2.           Out-of-Process.
In-Process stores the session in memory on the web server.
Out-of-Process Session state management stores data in an external server.  The external server may be either a SQL Server or a State Server.  All objects stored in session are required to be serializable for Out-of-Process state management.
How you can add an event handler?
Using the Attributes property of server side control.
e.g. btnSubmit.Attributes.Add("onMouseOver","JavascriptCode();")
What is caching?
Caching is a technique used to increase performance by keeping frequently accessed data or files in memory. The request for a cached file/data will be accessed from cache instead of actual location of that file.
What are the different types of caching?
ASP.NET has 3 kinds of caching:
·         Output Caching,
·         Fragment Caching,
·         Data Caching.
Which type if caching will be used if we want to cache the portion of a page instead of whole page?
Fragment Caching: It caches the portion of the page generated by the request. For that, we can create user controls with the below code:

1<%@Output Cache Duration="120" VaryByParam="CategoryID;SelectedID"%>
List the events in page life cycle.
·         Page_PreInit
·         Page_Init
·         Page_InitComplete
·         Page_PreLoad
·         Page_Load
·         Page_LoadComplete
·         Page_PreRender
·         Render
Can we have a web application running without web.Config file?
Is it possible to create web application with both web forms and mvc?
Yes. We have to include below mvc assembly references in the web forms application to create hybrid application
Can we add code files of different languages in App_Code folder?
No. The code files must be in same language to be kept in App_code folder
What is Protected Configuration?
It is a feature used to secure connection string information
Write code to send e-mail from an ASP.NET application?
·         MailMessage mailMess = new MailMessage ();
·         mailMess.From = "abc@gmail.com";
·         mailMess.To = "xyz@gmail.com";
·         mailMess.Subject = "Test email";
·         mailMess.Body = "Hi This is a test mail.";
·         SmtpMail.SmtpServer = "localhost";
·         SmtpMail.Send (mailMess);
·         MailMessage and SmtpMail are classes defined System.Web.Mail namespace
How can we prevent browser from caching an ASPX page?
We can SetNoStore on HttpCachePolicy object exposed by the Response object’s Cache property:
·         Response.Cache.SetNoStore ();
·         Response.Write (DateTime.Now.ToLongTimeString ());
What is the good practice to implement validations in aspx page?
Client-side validation is the best way to validate data of a web page. It reduces the network traffic and saves server resources.
What are the event handlers that we can have in Global.asax file?
Application Events: Application_Start , Application_End, Application_AcquireRequestState, Application_AuthenticateRequest, Application_AuthorizeRequest, Application_BeginRequest, Application_Disposed,  Application_EndRequest, Application_Error, Application_PostRequestHandlerExecute, Application_PreRequestHandlerExecute, Application_PreSendRequestContent, Application_PreSendRequestHeaders, Application_ReleaseRequestState, Application_ResolveRequestCache, Application_UpdateRequestCache
Session Events: Session_Start,Session_End
Which protocol is used to call a Web service?
HTTP Protocol
Can we have multiple web config files for an asp.net application?
What is the difference between web config and machine config?
Web config file is specific to a web application where as machine config is specific to a machine or server. There can be multiple web config files into an application where as we can have only one machine config file on a server.
Explain role based security?
Role Based Security used to implement security based on roles assigned to user groups in the organization.
Then we can allow or deny users based on their role in the organization. Windows defines several built-in groups, including Administrators, Users, and Guests.
<AUTHORIZATION>< authorization >
< allow roles="Domain_Name\Administrators" / >   < !-- Allow Administrators in domain. -- >
< deny users="*"  / >                            < !-- Deny anyone else. -- >
< /authorization >
What is Cross Page Posting?
When we click submit button on a web page, the page post the data to the same page. The technique in which we post the data to different pages is called Cross Page posting. This can be achieved by setting POSTBACKURL property of  the button that causes the post back. Findcontrol method of PreviousPage can be used to get the posted values on the page to which the page has been posted.
How can we apply Themes to an asp.net application?
We can specify the theme in web.config file. Below is the code example to apply theme:
<pages theme="Windows7" />
What is Redirect Permanent in ASP.Net?
Redirect Permanent Performs a permanent redirection from the requested URL to the specified URL. Once the redirection is done, it also returns 301 Moved Permanently responses.
What is MVC?
MVC is a framework used to create web applications. The web application base builds on Model-View-Controller pattern which separates the application logic from UI, and the input and events from the user will be controlled by the Controller.
Explain the working of passport authentication.
First of all it checks passport authentication cookie. If the cookie is not available, then the application redirects the user to Passport Sign on page. Passport service authenticates the user details on sign on page and if valid then stores the authenticated cookie on client machine and then redirect the user to requested page
What are the advantages of Passport authentication?
All the websites can be accessed using single login credentials. So no need to remember login credentials for each web site.
Users can maintain his/ her information in a single location.
What are the asp.net Security Controls?
·         <asp:Login>: Provides a standard login capability that allows the users to enter their credentials
·         <asp:LoginName>: Allows you to display the name of the logged-in user
·         <asp:LoginStatus>: Displays whether the user is authenticated or not
·         <asp:LoginView>: Provides various login views depending on the selected template
·         <asp:PasswordRecovery>:  email the users their lost password
How do you register JavaScript for webcontrols?
We can register javascript for controls using <CONTROL -name>Attribtues.Add(scriptname,scripttext) method.
In which event are the controls fully loaded?
Page load event.
What is boxing and unboxing?
Boxing is assigning a value type to reference type variable.
Unboxing is reverse of boxing ie. Assigning reference type variable to value type variable.
Differentiate strong typing and weak typing
In strong typing, the data types of variable are checked at compile time. On the other hand, in case of weak typing the variable data types are checked at runtime. In case of strong typing, there is no chance of compilation error. Scripts use weak typing and hence issues arises at runtime.
How we can force all the validation controls to run?
The Page.Validate() method is used to force all the validation controls to run and to perform validation.
List all templates of the Repeater control.
List the major built-in objects in ASP.NET?

Request to Download PDF

Post A Comment: