Showing posts with label Interview Questions. Show all posts
Showing posts with label Interview Questions. Show all posts

Wednesday, October 17, 2012

What is difference between the GET and POST methods?

  1. In GET Method, All the name value pairs are submitted as a query string in URL. But in the POST method name value pairs are submitted in the Message Body of the request. 
  2. GET Method is not secured as it is visible in plain text format in the Location bar of the web browser. But POST Method is secured because Name-Value pairs cannot be seen in location bar of the web browser. 
  3. Also in GET method characters were restricted only to 256 characters. But in the case of POST method characters were not restricted. 
  4. About form default, Get is the defualt method for any form, if you need to use the post method, you have to change the value of the attribute "method" to be Post.  
  5. About the data type that can be send, with Get method you can only use text as it sent as a string appended with the URL, but with post is can text or binary. 
  6. If get method is used and if the page is refreshed it would not prompt before the request is submitted again. And if post method is used and if the page is refreshed it would prompt before the request is resubmitted. 
  7. GET method can be bookmarked. But POST method can not be bookmarked.
  8. In GET method data is always submitted in the form of text. In POST method data is submitted in the form as specified in enctype attribute of form tag and thus files can be used in FileUpload input box.
  9. GET method should not be used when sending passwords or other sensitive information. POST method used when sending passwords or other sensitive information.
  10. GET method can be cached. POST method can not cached.

Friday, October 12, 2012

What is the difference between String and string

string is an alias for System.String. So technically, there is no difference. It's like int vs. System.Int32.

As far as guidelines, I think it's generally recommended to use string any time you're referring to an object. e.g.


string place = "world";

Likewise, I think it's generally recommended to use String if you need to refer
specifically the class. e.g.


string greet = String.Format("Hello {0}!", place);

Friday, September 14, 2012

What is the difference between WCF Service and Web Service?

WCF is a replacement for all earlier web service technologies from Microsoft. It also does a lot more than what is traditionally considered as "web services". Web service is a part of WCF where as WCF is combination of Webservice+MSMQ+Remoting+COM

Here are few important differences between WCF and Web service

  1. WCF is a programming model and API. "WCF Service" implies an app that is built using that programming model and API.
  2. WCF comes with .Net frame work 3.0/3.5. To use in 2.0 frame work we need to install MS add in component.
  3. Web service can be hosted on IIS only where as WCF can be hosted on IIS, Self hosting, Windows service and Windows activation service. Since WCF can be hosted in different applications it is flexible. 
  4. You can build a Web service using WCF, but you can also build a Web service using other APIs or "stacks". Like PHP or Java, for example.
  5. WebService and WebMethod are used in web services where as in WCF - Service contracts, Operation contacts, Message contacts, Data contacts and Fault contacts are used in the service. 
  6. WebService can be accessed over HTTP, TCP, Custom where as WCF can be accessed over HTTP, TCP, Named pipes, MSMQ , Custom and P2P.  
  7. In Webservice unhandled exceptions are returned to clients where as in WCF a configuration settins is provided for these faults.  
  8. Webservice use System.Xml.serialization to translate data where as WCF uses System.Runtime.Serialization name-space.  
  9. "Basically, WCF is a service layer that allows you to build applications that can communicate using a variety of communication mechanisms. With it, you can communicate using Peer to Peer, Named Pipes, Web Services and so on.

Tuesday, September 4, 2012

Difference between ASP and ASP.NET

Hi all,

Difference between ASP and ASP.NET


ASP.NET:

  1. ASP.Net web forms have a code behind file which contains all event handling code.
  2. ASP.Net web forms inherit the class written in code behind.
  3. ASP.Net web forms use full fledged programming language
  4. ASP.Net web applications are configurable (web.config)
  5. ASP.Net webforms can use custom controls through the @ register directive
  6. ASP.Net web forms have ADO.Net which supports XML integration and integration of data from two or more data sources
  7. Variety of compilers and tools available including the Visual studio.Net.
  8. Completely Object Oriented.
  9. Complete session and application state management.
  10. Full proof error handling possible.


ASP:


  1. ASP does not have such facility to separate programming logic from design.
  2. ASP does not have the concept of inheritance.
  3. ASP pages use scripting language.
  4. ASP applications are not.
  5. It is not available with ASP.
  6. while ASP has ADO which is a simple COM object with limited facilities.
  7. Limited development and debugging tools available.
  8. Limited OOPS support.
  9. Limited session and application state management.
  10. Poor Error handling system.

Thursday, August 30, 2012

What is the difference between <%# Bind(“”) %> and <%# Eval(“”) %> in ASP.NET?

Question : - 

In a gridview, we can use <%#Eval%> or <%#Bind%> to output values from a database. What is the difference between them?

Answer :-

  • Eval is one way binding, Bind is two way
  • If you bind a value using Eval, it is like a read only. You can only view the data.
  • If you bind a value using Bind, and if you do some change on the value it will reflect on the database also