ASP.NET Interview Questions and Answers (1544) - Page 23

What is Security policy ?

The configurable set of rules that the CLR follows when determining the permissions to grant to code.
What are the Security policy levels in Dot Net ?

1) Enterprise
2) Machine
3) User and
4) Application Domain

each of these are independent from each other and Each level has its own code groups and permission sets.
What is the class for getting the information that is on Clipboard of your system in windows app ?

System.Windows.Clipboard is the class used to get what is on clipboard like text , mage etc.
What is the use of DataPager control?

DataPager control is the new control introduced in the ASP.NET 4.0. This control is used to do pagination in the Data controls like ListView Server control.

The typical syntax of DataPager control is

<asp:DataPager ID="DataPager1" runat="server" PagedControlID="ListView1" PageSize="5" QueryStringField="pageid">

<Fields>
<asp:NumericPagerField ButtonCount="5" />
</Fields>
</asp:DataPager>


Where PagedControlID is the id of the Listview, PageSize is the number of records to be displayed in the page, QueryStringField is the querystring for the current page number.

The fields properties can be used to show how many pagination button you would like to have when asp.net creates the paging for your ListView control.

More about DataPager control can be found at http://www.dotnetfunda.com/articles/article122.aspx
what is the difference between garbage collection and Dispose Method

if you want to delete resources(objects) those are not using you should not worry about that garbage collecter implicitly call finalize() method and remove all such object but if you want to delete object forcefully(The larger object you want to delete after completeing task) than you can explicitly call dispose() method.
How can we Filter rows in a Datatable ?

A filter condition can be specified on a datatable to filter row based on the condition specfied

datatable =  datatable.select("Condition");

Can we have same method with same name and signature in a using partial class ?

Partial class is the concept of diving a class file in to different files or a single file to enhance the productivity .

We cannot have the same method with same name and signature in partial class it give a compile time exception
what is yeild keyword in .net ?

When ever user want to return a value from an iterator block and again contine from in the iterator block we use yeild keyword it is used to return the value from a iterator block, it is not supported in vb.net
What is the use of Global.asax File in ASP.NET Application ?

The Global.asax file is an optional file and can be stored
in root directory. This File is in accesible for web-sites.
This Global.asax file contained in HttpApplicationClass.
In Global.asax file we can declare global variables like for
example the variables used in master pages because same
variables can be used for different pages right.It provides
more security than others.
The Global.asax file is used to handle application-level
and session-level events.
we donot worry about configuring Global.asax because it is
itself configured. Accessing the Global.asax file can not be possible.
while one request is in processing it is impossible to
send another request, we can not get response for other
request and even we can not start a new session.
while adding this Global.asax file to our application bydefault it contains five methods,
Those methods are:
1.Application_Start.
2.Application_End.
3.Session_Start.
4.Session_End.
5.Application_Error.
what is the default port for Http and Https ?

NOTE: This is objective type question, Please click question title for correct answer.
What is the Default Expiration Period For Session and Cookies?

Session
The default Expiration Period for Session is 20 minutes

Cookies
The default Expiration Period for Cookie is 30 minutes
What is the maximum size of viewstate?

The maximum size of the viewstate is 25% of the page size.
If there is master page attached to the aspx page then which page load event will fire first?

NOTE: This is objective type question, Please click question title for correct answer.
What is the maximum size of uploading file?

In the web.config.comments file, find a node called <httpRuntime> that looks like the following:
<httpRuntime
executionTimeout="110"
maxRequestLength="4096"
requestLengthDiskThreshold="80"
useFullyQualifiedRedirectUrl="false"
minFreeThreads="8"
minLocalRequestFreeThreads="4"
appRequestQueueLimit="5000"
enableKernelOutputCache="true"
enableVersionHeader="true"
requireRootedSaveAsPath="true"
enable="true"
shutdownTimeout="90"
delayNotificationTimeout="5"
waitChangeNotification="0"
maxWaitChangeNotification="0"
enableHeaderChecking="true"
sendCacheControlHeader="true"
apartmentThreading="false" />


A lot is going on in this single node, but the setting that takes care of the size of the files to be uploaded is the maxRequestLength attribute. By default, this is set to 4096 kilobytes (KB). Simply change this value to increase the size of the files that you can upload to the server. If you want to allow 10 megabyte (MB) files to be uploaded to the server, set the maxRequestLength value to 11264, meaning that the application allows files that are up to 11000 KB to be uploaded to the server.
If there is one apllication, containing 10 folders, then how many maximum web.config can contain in that application?

NOTE: This is objective type question, Please click question title for correct answer.
Can we put web.config in sub folders & which will applicable for the application?

We can put one web.config in each subfolders but which is at the application root folder web.config will consider as the main web.config.
What is the maximum Number of Tables Stored in Dataset?

The maximum size is limited by Int32. So 2^32 is the maximum number of DataTables you can hold inside a DataSet. So the max size is 2 billion.
How many tables can we store in the dataset?

There is no limit for the storing of tables in the dataset. We can use many tables in a single dataset.
Who calls the validation controls?

In ASP.NET 1.0 it was handled by webuivalidation.js script file. The scripts are now included in the page straight from the DLL. This is done through the special handler (/WebResource.axd), so you can't edit the javascript files.
Found this useful, bookmark this page to the blog or social networking websites. Page copy protected against web site content infringement by Copyscape

 Interview Questions and Answers Categories