Monday, 30 June 2014

FAQ'S ON ASP.NET QUESTIONS

1. what is web.config file?

web.config file is an Xml file which is used to maintain the configuration settings that are required for ASP.net web application under web.config file we can declare the connectionstrings and session state
modes globally

2. How many web.config file we can declare for a single web application?
Ans:- More than one

3) Can we declare more than one connectionstring in web.config file?
yes but both the connectionstrings names must be different

4) What is App_code folder?
All theclasses,dataset that are stored in App_Code are automatically accessible throughout the application. If we store any class files (like .cs or .vb) it compiles them automatically

5) Can we use more than 1 master page in a website?
Yes

6) What is the difference between Response.Redirect() and Server.Transfer()?
Ans:- 
1. Response.Redirect() is used to navigate the user request between multiple webservers
    whereas Server.Transfer() is used to navigate the user request within the webserver.
2. Response.Redirect() will not hide the Destination url address.
    Server.Transfer() will hide the destination url address

7) Difference between webuser control & custom control?
1. Custom controls can be added to toolbox whereas usercontrols cannot be added to toolbox
2. User controls are easier to create compare to custom controls
3. A separate copy of user controls is required in each application you want to use whereas
single copy of custom controls can be used in multiple projects

8) What are the Different Page Level events that are available in ASP.NET?
Page_PreInit,
Page_Init,
Page_InitComplete,
Page_PreLoad, 
Page_Load,
Page_ControlEvents
Page_LoadComplete,
Page_PreRender,
Page_SaveStateComplete
Page_Render
Page_Unload
For More: - Click Here

9) What is the use of Page_PreInit Event?
This Event is used to Load the Master pages, Themes and skins,Css Dynamically

10) In which Event all the controls are loaded?
Page_Load

11) Which Event will first fire?  Ans: (b)
a)Page_Load
b)Page_PreInit
c)Page_Unload

12) What is the Difference between Themes and skins and CSS?
Ans:- 
1. CSS will be applied at Design time but Themes and Skins will be applied at Runtime
2. CSS will work at client-side whereas Themes and Skins will work at server side

13) What is the Difference between SQLDataReader and Dataset?
1. SQLDataReader will work with connection oriented Architecture and Dataset will work
    with Disconnection oriented Architecture.
2. We need to Open and close the connection while working with SqlDataReader and it is not
   required to Open and close the connection while working with Dataset
3. SqlDataReader will read the data in Forward only Direction but Dataset will read the data in
   Bi-Directional
4. We cannot perform DML Operations on DataReader but we can perform on Dataset
5. SqlDataReader will affect the original database where dataset will store the data in a
temporary memory

14) When to use Connected Oriented Architecture and Dis-connected Oriented Architecture?
If we require a continuous connection with the Data Source for accessing data 
Here the “DataReader” class holds the data on client machines.
If we do not require a continuous connection with the Data Source for accessing data.
Here the “DataSet” class holds the data in the client machines.

15) What is SQlCommandBuilder Class?
SqlCommandBuilder class in ADO.NET provides the feature of reflecting the changes made to a DataSet to database.
When an instance(object) of the SqlCommandBuilder class is created, it automatically generates Transact-SQL statements for the single table updates that occur. 

16) Where to declare the Connectionstring Globally ?
Web.config file

17) How to Declare the Connectionstring globally?
Ans:- Inside Web.Config File
</configSections>
    <appSettings>
           <add key="ConnectionName" value="Data Source=databaseName;Initial                                                              Catalog=databaseName;Integrated Security=True"/>
    </appSettings >
<connectionStrings/>

18) What is the Difference between web.config and machine.config file?
web.config: It is the maintain the configuration settings that are required for ASP.NET web application.
machine.config: It contains settings that apply to an entire computer. This file is located in
C:\WINDOWS\Microsoft.NET\Framework\v4.0.30319\Config\machine.config

Machine.config contains configuration settings for machine-wide assembly binding, built-in remoting channels, and ASP.NET.

19) How many machine.config files we can have for a single computer?
only one

20) What is a viewstate?
viewstate is client side state management Technique which is used to maintain the state of the response on browser
viewstate internally uses hidden fields to maintain the response

21) Can we Disable the Viewstate?
EnableViewstate=false

22) What is the scope of Viewstate?
within the page

23) How to maintain the state in ASP.net without using State management Techniques?
Crosspage postBack

24) What is AutoPost?
if Autopost==false then the request will not go to the server else request will go to the server
Ex:- Dropdownlist

25) What is IsPostBack?
IsPostBack is the property of the Page class which is used to determine whether the page is
posted back from the client. If IsPostBack property is false, then the page is loading for the first time, and if true, then the request is because of some event generated by web controls.

26) What is the difference between Autopostback and IsPostBack?
Autopostback is the property of the control IsPostBack is the property of the Page class

27) What is the Difference bewteen Hyperlink button and Link Button?
The HyperLink will not PostBack the webpage to the server.but Link Button will postback the
webpage to the server

28) What is stored procedure?
storedprocedure is a set of pre-compiled sql statements which which will gets executed when we call it.

29) What is a Cookie?
Cookie is a client side state management technique which is used to maintain the data on the browser in plain text format. 

30) What is the Scope of Cookie?
Through out the website

31) What is the Difference between Cookie and Session?

32) What is the drawback with QueryString?
QueryString will maintain the data in browser url address

33) What are the different session state modes that are available?
Inproc,Off,Sqlserver,Stateserver,custom

34) What is the Default Session state mode?
Inproc

35) What is the Default Expiry time out of Session?
20 minutes

36) How to Generate Session state Tables in SQLSERVER?
aspnet_regsql Tool

37) How to kill a Session?
Session.Abandon() or by using timeout property

38) What is Application?
Application is a server side state management Technique which is used to maintain the state of the response on the server Application memory is used to Declare Global variables 

39) What are the Different Application Level
Events that are available?
Application_Start
Session_Start
Application_Error
Session_End
Application_End

40) Where all the Application level events are available?
global.asax

41) Which event will first fire
a)Page_Preinit
b)Page_Load
c)Application_Start (c)

42) What is Caching?
Caching is a server side state management Technique which is used to maintain the state of the response in a temporary cache memory

43) What are the Different Caching Techniques that are available?
output caching
partial page caching
Data caching

44) What is the difference between Caching and Application?
Application variable is the global variable specific to application but a caching variable is specific to page and time out 
Application variables exist as long as the application is alive. Whereas the cache has the
Property of timeout which allows us to control the duration of the Objects so cached

45) How to Provide Security in ASP.net Windows Authentication
Forms Authentication
Passport Authentication

46) What is the Difference between Authentication and Authorization?
Authenticationis the process of checking user credntials and Authorization is the process
of assigning the roles and responsabilities to Authenticated users

47) What is Forms Authentication?
Forms Authentication is used to provide security for ASP.net web application

48) What is the use of UpdatePanel in AJAX?
UpdatePanel is used for partial page postback

49) What the Different Validation controls in ASP.net?
1. Required Filed validator
2. Compare validator
3. Range validator
4. Regular Expression validator
5. custom validator
6. validation Summary

50) How to perform client side validations in ASP.net?
Javacsript

51) How to reduce the burden on the page
by using paging

No comments:

Post a Comment