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

Which object do you use when you need to know the type and version of the browser requesting the current web page?

NOTE: This is objective type question, Please click question title for correct answer.
On which of these classes, we can apply skins?

NOTE: This is objective type question, Please click question title for correct answer.
Which of these security aspects allow you to modify users properties?

NOTE: This is objective type question, Please click question title for correct answer.
Which of these properties of a Web Page is true when you post to another page ?

NOTE: This is objective type question, Please click question title for correct answer.
Which of these events of a web page are fired during asynchronous postback?

NOTE: This is objective type question, Please click question title for correct answer.
Which of these files is also called as AJAX Client Library?

NOTE: This is objective type question, Please click question title for correct answer.
Which of these are valid MIME types?

NOTE: This is objective type question, Please click question title for correct answer.
Which of these parameters are not used with SqlDataSource control?

NOTE: This is objective type question, Please click question title for correct answer.
Can we implement Cookieless Forms Authentication?

Yes, we can implement Cookieless Forms Authentication.
But, we have to use appropriate tags in the Web.Config file.

example:

<configuration>

<system.web>
<authentication mode="Forms">
<forms cookieless="AutoDetect'>
</authentication>
</system.web>
</configuration>


"AutoDetect": If Cookie header is there, the cookie is assigned. If Cookie header
is not there , ASP.NET will use Cookieless authentication.

"UseUri" attribute can also be used where an authentication cookie will never
be used.

How can you detect the Windows' user name in ASP.NET?

It can be done using this code snippet?


  WindowsPrincipal w = new WindowsPrincipal(WindowsIdentity.GetCurrent());


Response.Write(w.Identity.Name);



First include the namespace: System.Security.Principal
Whioch of these controls is useful if runtime User Interface is not needed?

NOTE: This is objective type question, Please click question title for correct answer.
Which of these represents neutral culture?

NOTE: This is objective type question, Please click question title for correct answer.
There is a web page in which the user interface should be in English but the calendar dates should be in some regional language. How can you do that?

Go to the properties of the web page

Select Document->Culture--> Select the culture from the DropDown that opens up.

example: hi-IN Hindi (India) for Hindi dates.
Which of these cannot be a web part?

NOTE: This is objective type question, Please click question title for correct answer.
Which directive/attribute is generated in a .aspx page that references the master page?

NOTE: This is objective type question, Please click question title for correct answer.
Which is the base class for health-monitoring audit events?

NOTE: This is objective type question, Please click question title for correct answer.
When health monitoring is enabled, which property is required in the health monitoring section of the web.config file?

NOTE: This is objective type question, Please click question title for correct answer.
Which property of MembershipProvider is used to track the time interval for the failed login attempts?

PasswordAttemptWindow is the property which gives the time in minutes.
It is generally written in the Web.Config file
ex:
<configuration>
<system.web>
<membership defaultProvider="MyProvider">
<providers>
<add
name="MyProvider"
type="System.Web.Security.SqlMembershipProvider"
passwordAttemptWindow="30"/>
</providers>
</system.web>
</configuration>

The value is 30 minutes in this case.
How can you prevent a cookie from cross side script attacks?

Use HttpOnly property of the cookie when it is created.
It prevents the cookie from being accessible through Javascript.

ex:
HttpCookie h=new HttpCookie("userinfo");
h.HttpOnly=true;
h.Value="dd";
h.Expires=DateTime.Now.AddMinutes(3);
Response.Cookies.Add(h);
How many role providers are there in ASP.NET ?

Roles are basically classes that provide us with features to implement authorization for a group of users.
example: A role known as Managers can be used to provide access to a particular folder in the web site
to a group of users under its name.

3 role providers are there in ASP.NET

1) SqlRoleProvider : we can store role information in SQL Server database

2)WindowsTokenRoleProvide r: we can use Windows user accounts to represent roles.

3)AuthorizationStoreRoleProvider :

Manages storage of role-membership information in XML File/Active Directory
/Active Directory Application Mode (ADAM)

The above are all the classes defined by System.Web.Security namespace.
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