Asp.Net Question on Server Objects

Published On: 4/21/2023
Author: Admin
Share Now

Asp.Net Questions on Server Objects with answers. These question and answers on Asp.Net Server Objects are useful in interview preparation for Freshers and Experienced asp.net developers.

Q. 1 What is Intrinsic Objects?

The page itself is instantiated as a control object. All web forms are basically instances of the ASP.NET Page class. The page class has the following extremely useful properties that correspond to intrinsic objects:

  • Session
  • Application
  • Cache
  • Request
  • Response
  • Server
  • User
  • Trace

Q. 2 What are the Properties of server Object?

Properties of server object are as follow:

  • MachineName
  • ScriptTimeOut

Q. 3 What is use of CreateObject(String) method?

CreateObject(String) method Creates an instance of the COM object identified by its ProgID (Programmatic ID).

Q. 4 What is use of CreateObject(Type) method?

CreateObject(Type)method of Server Object Creates an instance of the COM object identified by its Type.

Q. 5 Which method is used to compare two server objects?

Equals(Object) method of Asp.net server object Determines whether the specified Object is equal to the current Object.

Q. 6 Explain asp.net server object method Execute(String)!

Execute(String) method of Asp.net server object Executes the handler for the specified virtual path in the context of the current request.

Q. 7 What is use of Execute(String, Boolean) method of Asp.Net server object?

Asp.net Server object's Execute(String, Boolean) method Executes the handler for the specified virtual path in the context of the current request and specifies whether to clear the QueryString and Form collections.

Q. 8 Which method is used to get last exception of Server Objects in Asp.net?

GetLastError method of Asp.Net server object Returns the previous exception.

Q. 9 How to get Type of current Instance?

Asp.net server object's GetType method Gets the Type of the current instance.

Q. 10 How to change an Ordinary string into legal HTML characters?

HtmlEncode method of ASP.NET server object changes an ordinary string into a string with legal HTML characters.

Q. 11 How to convert HTML string into ordinary string?

Asp.Net server object has HtmlDecode method which Converts an Html string into an ordinary string.

Q. 12 What is use of ToString method?

ToString method Returns a String that represents the current Object.

Q. 13 What is use of Transfer(String) method in Asp.Net?

Transfer(String)method is used to terminates execution of the current page and starts execution of a new page by using the specified URL path of the page for the current request

Q. 14 Explain UrlDecode method of asp.net server object!

UrlDecode method Converts an URL string into an ordinary string. UrlDecodeToken method Works same as UrlDecode, but on a byte array that contains Base64-encoded data.

Q. 15 What is function of UrlEncode Method?

UrlEncodemethod of asp.Net Server object converts ordinary string into URL string.

Q. 16 What is use of MapPath Method?

MapPath method Return the physical path that corresponds to a specified virtual file path on the server.

Q. 17 What is Request Object?

The request object is an instance of the System.Web.HttpRequest class. It represents the values and properties of the HTTP request that makes the page loading into the browser.

The information presented by this object is wrapped by the higher level abstractions (the web control model). However, this object helps in checking some information such as the client browser and cookies.

Q. 18 Write down Properties of Request Object!

Asp.Net has following properties of Request object.

AcceptTypes, ApplicationPath, Browser, ContentEncoding, ContentLength, ContentType, Cookies, FilePath, Files, Form, Headers, HttpMethod, InputStream, IsSecureConnection, QueryString, RawUrl, RequestType, ServerVariables, TotalBytes, Url, UrlReferrer, UserAgent, UserHostAddress, UserHostName, UserLanguages etc.


Q. 19 How to get virtual application root path in asp.Net?

ApplicationPath property of Request object is used to get ASP.NET application's virtual application root path on the server.

Q. 20 When browser property of Request Object is used?

To Gets or sets information about the requesting client's browser capabilities.

Q. 21 How Cookies can be used?

Cookies property of Request Object is used to Gets a collection of cookies sent by the client.

Q. 22 What is purpose of QueryString property?

QueryString property of Request object is used to Gets the collection of HTTP query string variables.

Q. 23 How to get IP Host address of remote client?

Asp.Net Request Object has property UserHostAddress, this UserHostAddress property Gets the IP host address of the remote client.

Q. 24 Write down Methods of Request Object!

Following are some important methods of Asp.Net Request Object.

BinaryRead, Equals(Object), GetType, MapImageCoordinates, MapPath(String), SaveAs, ToString, ValidateInput


Q. 25 What is use of ValidateInput Method?

ValidateInput Method Causes validation to occur for the collections accessed through the Cookies, Form, and QueryString properties. ValidateInput in important method of Asp.net Request Object.

Q. 26 Describe Response Object!

The Response object represents the server's response to the client request. It is an instance of the System.Web.HttpResponse class.

In ASP.NET, the response object does not play any vital role in sending HTML text to the client, because the server-side controls have nested, object oriented methods for rendering themselves.

However, the HttpResponse object still provides some important functionalities, like the cookie feature and the Redirect() method. The Response.Redirect() method allows transferring the user to another page, inside as well as outside the application. It requires a round trip.

Q. 27 What are the Properties of Response Object?

Response Object has following Properties.

Buffer, BufferOutput, Charset, ContentEncoding, ContentType, Cookies, Expires, ExpiresAbsolute, HeaderEncoding, Headers, IsClientConnected, Output, OutputStream, RedirectLocation, Status, StatusCode, StatusDescription, SubStatusCode, SuppressContent etc.

Q. 28 What are the Methods of Response Object

Asp.Net Response object has following Methods.

AddHeader, AppendCookie, AppendHeader, AppendToLog, BinaryWrite, ClearContent, Close, End, Equals(Object), Flush, GetType, Pics, Redirect(String), Redirect(String, Boolean), SetCookie, ToString, TransmitFile(String), Write(Char), Write(Object), Write(String), WriteFile(String), WriteFile(String, Boolean) etc.

#asp.net #programming #interview #questions #Lifecycle, asp net questions, asp dot net interview questions, asp net interview questions and answers, asp net basic interview questions, asp net c# interview questions, #Server_Objects, #Server_Response

Practice Tests Available

Currently no practice papers available for above exam. We are working on it and tests will be available soon.


Subjects (Free Online Tests)

Your Comment:
Name :
Comment :
(0) Comments:

 Full Length Mock Tests
 Answers with Explanation**
 Timer Based Exams
 Instant Result and assesment
 Detailed analasys of Result