Monday 23 December 2013

Interview Question on Asp.Net

                                                                                                                                                Next.....

What is Asp.Net:- Asp.net is abbreviated as "Active Server Pages .Network enable technology".
Active-An ASP page provides dynamic content that's updated every time that is accessed.
Server- An ASP page contains script code that the Web server executes.
Pages-An ASP page is a Web page that the user navigates to and is displayed in his or her browser.

How many types of Validation control in Asp.Net:- 
  • Required Field Validator
  • Range Validator
  • Compare Validator
  • Regular Expression Validator
  • Custom Validator
  • Validation Summary

Required Field Validator:-It checks whether the control have any value. It is used when you want the control should not be empty.
Range Validator:-It checks if the value in validated controls is in that specific range.
Compare Validator:-It checks that the value in controls should match some specific value.
Regular Expression Validator:-When we want the control, value should match with a specific regular expression.
Custom Validator:-It is used to define user defined validation.
Validation Summary:-It displays summary of all current validation errors on an Asp.Net page.

How can you redirect user to different page.

By Useing the Response.Redirect method to direct users to different pages.

How can you redirect user to same page.

By Useing the Server.Transfer method to direct users to different pages.

SqlConnection in Web Configuration File :-

(1) Connection when username and password exist

<connection string>
<Add="Connect"connectionString="server=Servername;database=databasename;uid=username;pwd=password" providerName="system.data.sqlclient"/>
</connectionstring>
(2) Connection by using web authentication:-
<connection string>
<Add="Connect"connectionString="server=Servername;database=databasename;Integrated Security=True" providerName="system.data.sqlclient"/>
</connectionstring>

Authentication :-It is verifying the identity of a user.
Authorization :- It is the process where we check does this identity have access right to the system

How many Types of Authentication Technique in Asp.Net 

There are three types of Authentication techniques are :
  • Windows Authentication
  • Passport Authentication
  • Form Authentication
Window Authentication:- It is generally use if the resources the application belong to same organisation. Example:Internet Web application.

Passport Authentication:-It is based on the passport website provided by microsoft So when user login with credentials it will be  reached to the passport website (i.e. hotamil,window live) where authentication will happen.If authentication is successful it will return a token to your website.

Form Authentication:- This is cookies based authentication where password and username are stored on the client machines as cookies file or they are sent through URL for every request Form-Based authentication present the with an HTML-based web page that prompts the user for credential. Ex. Commercial website

Anonymous Access:- I we do not want any type of authentication then we will use Anonymous access.
      Ex-Public internet web application. 
What are the five different ways of handling state in ASP.Net Web forms?
State management Technique is a process by which we maintain the state & page into over multiple request for the same of different page.

The Sequence in which Asp.Net Event occurs

  • Page Init
  • Page Load
  • Control Event
  • Page Unload Event

 ASP.NET different from ASP Click here

 What ASP.NET class reads the contents of a form after the user clicks the Submit button?
The HttpResponse class reads the content of the form. You access this class using the Response object, where you can use the Form or Parameters collection to find each form entry.

                                                                                                                                                    Next.....

C# program Selection Sorting

Selection sort is a straightforward sorting algorithm. This algorithm search for the smallest number in the elements array and then swap i...