Asp.net interview basic questions and answers
What are the different validators in ASP.NET?
- Required field Validator
- Range Validator
- Compare Validator
- Custom Validator
- Regular expression Validator
- Summary Validator
What is cross page post back?
In cross page post back method the URL remains the same but in cross page posting there is
little different there is normal post back is done but in target page we can access values
of server control in the source page. This is quite simple we have to only set the PostBackUrl
property of Button, LinkButton or imagebutton which specifies the target page. In target page
we can access the PreviousPage property.And we have to use the @PreviousPageType directive.
We can access control of PreviousPage by using the findcontrol method.When we set the
How many type of error in .net ?
Asp.net interview questions
How many type of cookie in asp.net?
They are 2 types of cookies.
1) Session Cookies & 2) Persistence Cookies
* in-memory cookies (commonly used cookies)
* persistent cookies (when we select/check "remember password" like those situations these will be used.)
Read more about
Cookies in asp.net
What is the difference between Server.Transfer and Response.Redirect?
This tells the browser that the requested page can be found at a new location. The browser then initiates another request to the new page loading its contents in the browser. This results in two requests by the browser.
It transfers execution from the first page to the second page on the server. As far as the browser client is concerned, it made one request and the initial page is the one responding with content. The benefit of this approach is one less round trip to the server from the client browser. Also, any posted form variables and query string parameters are available to the second page as well.
Can you explain ASP.NET application and Page life cycle
How can we do Inproc and outProc session management ?
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.
What is ViewState? How long any object can remain in ViewState ?
ViewState is used to retain the state of server-side objects between page post backs.
They exist for the life of the current page. once user leave the page ViewState gets expired.
What is caching? What are the different types of 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 location instead of actual location of that file.
There are 3 type of caching in ASP.NET
- Data Caching.
- Fragment Caching,
- Output Caching,
Read more about
Caching in asp.net
Tell me all events in page life cycle.
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.
What is Cross Page Posting?
The way we post the data to different pages is called Cross Page posting
what are the templates of the Repeater control?
Which data type does the RangeValidator control support?
Data types Integer, Double, String, Currency, and Date are supported by the RangeValidator control