Asp .Net Interview Question and Answer | Web Application | Session 14

131. Explain the differences between server-side and client-side code in Asp.Net? 
Ans: In Asp.Net Environment Server side code or scripting means the script will executed by server as interpreted needed.Server side scripting done the bussines logic like transaction and fetching data to Sever.
     Client side scripting means that the script will be executed immediately in the browser such as form field validation, clock, email validation, etc. Client side scripting is usually done in VBScript or JavaScript. Since the code is included in the HTML page, anyone can see the code by viewing the page source.
Ques: 106 What is Postback in Asp.net?
Ans: Postback is the event which sends the form data to the server. The server process the data and send it back to the browser.


132. What is  IsPostback? 

 Ans: ispostback propertyof the page object may be used to check whether page is postback or not.
 

133. Explain Web Services? 
Ans: Web services are programmable business logic components that provide access to functionality through the Internet. Web services are given the .asmx extension.Standard protocols like HTTP can be used to access them. Web services are based on the Simple Object Access Protocol (SOAP), which is an application of XML.In .Net FrameWork Web services convert your application in to Web Application.which published their functionality to whole world on internet.Web Services like a software system  that designed to support interoperable machine-to-machine interaction over a Internet.
 

134. What is Shallow Copy and Deep Copy in .NET? 
Ans: Shallow copy:When a object creating and copying nonstatic field of the current object to the new object know as shallow copy.
If a field is a value type --> a bit-by-bit copy of the field is performed
a reference type --> the reference is copied but the referred object is not; therefore, the original object and its clone refer to the same object.

Deep copy:Deep cooy little same as shallow copy,deep copy the whole object and make a different object, it means it do not refer to the original object while in case of shallow copy the target object always refer to the original object and changes in target object also make changes in original object.
 

135. What is CLR? 
Ans: The CLR(Common Language Runtime) is described as the execution engine of .NET. It provides an environment within which the program run.
It is this CLR that maneges the executin of program and provides some core service- code compilation , memory allocation,thread manegment and gurbage collection.
Ques: 110 Explain Namespace ?
Ans: A Namespace is just a grouping of releted classes. It is a method of putting class inside a container so that they can be clearly recognised from other classes with same name.

The ASP.NET Framework gives you the most commonly used namespaces:
. System
. System.Collections
. System.Collections.Specialized
. System.Configuration
. System.Text
. System.Text.RegularExpressions
. System.Web
. System.Web.Caching
. System.Web.SessionState
. System.Web.Security
. System.Web.Profile
. System.Web.UI
. System.Web.UI.WebControls
. System.Web.UI.WebControls.WebParts
. System.Web.UI.HTMLControls
 

136. What are the advantages and disadvantage of Using Cookies? Ans: Advantage:
        1.Cookies do not require any server resources since they are stored on the client.
        2. Cookies are easy to implement.
        3. Cookies to expire when the browser session ends (session cookies) or they can exist for a specified length of time on the computer (persistent cookies).

Disadvantage:
        1. Users can delete a cookies.
        2. Users browser can refuse cookies,so your code has to anticipate that possibility.
        3. Cookies exist as plain text on the client machine and they may security risk as anyone can open and tamper with cookies.
 

137. What is the difference between Session Cookies and Persistent Cookies? 
Ans: When client broweses session cookie stored in a memmory.when browser closed session cookie lost.
//Code to create a UserName cookie containing the name David.
HttpCookie CookieObject = new HttpCookie("UserName", "David");
Response.Cookies.Add(CookieObject);

//Code to read the Cookie created above
Request.Cookies["UserName"].Value;

Persistent cookie same as the session cookie except that persistent cookie have expiration date.The expiration date indicates to the browser that it should write the cookie to the client's hard drive.
//Code to create a UserName Persistent Cookie that lives for 10 days
HttpCookie CookieObject = new HttpCookie("UserName", "David");
CookieObject.Expires = DateTime.Now.AddDays(10);
Response.Cookies.Add(CookieObject);

//Code to read the Cookie created above
Request.Cookies["UserName"].Value;
 

138. What are the steps to host a web application on a web server?Ans: Steps:  1. Set up a virtual folder for the application using IIS.
                       2. Copy the Web application to the virtual directory.
                       3. Adding the shared .NET components to the server’s global assembly cache (GAC).
                       4. Set the security permissions on the server to allow the application to access required resources.
 

139. What happens when you make changes to an application’s Web.config file? 
Ans: When make change in web.config file.IIS restarts application and automatically applies changes.This effect the Session state variable and effect the application,then user adversely affected.
 

140. What is Globalization ? 
Ans: The process to make a Application according to the user from multiple culture.The process involves translating the user interface in to many languages,like  using the correct currency, date and time format, calendar, writing direction, sorting rules, and other issues.Accommodating these cultural differences for an application is called Globlization.
Three different ways to globalize web applications:
       1. Detect and redirect approach
       2. Run-time adjustment approach
       3. Satellite assemblies approach



Previous Next


:: Click the links below for similar type Questions and answers ::

2 comments:

rmouniak said...

I like your blog, thanks for sharing

Dot Net Online Training

Janu said...

Thanks a lot for sharing such a good source with all, i appreciate your efforts taken for the same. I found this worth sharing and must share this with all.




Dot Net Training in Chennai | Dot Net Training in anna nagar | Dot Net Training in omr | Dot Net Training in porur | Dot Net Training in tambaram | Dot Net Training in velachery





Post a Comment

 
Design by Wordpress Theme | Bloggerized by Free Blogger Templates | coupon codes