What is the difference between code inline and code behind models in Asp.Net?

Code-Inline model in Asp.Net
In Code-Inline model the code & event handlers for the controls are located in <script> blocks in the same .aspx file that contains the HTML and controls. Code-Inline model is useful when you want to maintain your code and presentation logic in a single file.

Code-behind model in Asp.Net
ASP.NET also supports another way to factor your code and presentation content, called the code-behind model. When using code-behind, the code for handling events is located in a physically separate file from the page that contains server controls and markup. This clear delineation between code and content is useful when you need to maintain these separately, such as when more than one person is involved in creating the application. It is often common in group projects to have designers working on the UI portions of an application while developers work on the behavior or code. The code-behind model is well-suited to that environment.

What are the main differences between asp and asp.net?

ASP 3.0

• Supports VBScript and JavaScript
. scripting languages are limited in scope
. interpreted from top to bottom each time the page is loaded
• Files end with *.asp extension
• 5 objects: Request, Response, Server, Application, Session
• Queried databases return recordsets
• Uses conventional HTML forms for data collection


• Supports a number of languages including Visual Basic, C#, and JScript
. code is compiled into .NET classes and stored to speed up multiple hits on a page
. object oriented and event driven makes coding web pages more like traditional applications
• Files end with *.aspx extension
• .NET contains over 3400 classes
• XML-friendly data sets are used instead of recordsets
• Uses web forms that look like HTML forms to the client, but add much functionality due to server-side coding
• Has built-in validation objects
• Improved debugging feature (great news for programmers)
• ASP .NET controls can be binded to a data source, including XML recordsets

What is a postback? and when is it used in ASP.NET Web forms?

A postback is the name for the page request that an ASP.NET page sends to itself when a Web control is activated, such as when users click a button. Most Web forms use the HTML form control, which allows users to submit data using HTTP Post requests.

What is a template in the context of ASP.NET controls?

A template is a set of HTML or ASP.NET code displayed in a list or grid format by the Repeater, DataGrid, or DataList control.

How can you redirect users to a different page?

Use the Response.Redirect method to direct users to different pages. Remember that you must call this method before any HTML is rendered for a page.

What is difference between xml and html?

XMl describe the data or we can say its like a database which get the data and helps in fetching the data on the other side HTML is use only for displaying the data so we can say HTML is static information displayer.

Difference Between GET and POST methods in HTML.

Difference between GET and POST methods

1) Data is appended to the URL.
2) Data is not secret.
3) It is a single call system
4) Maximum data that can be sent is 256.
5) Data transmission is faster
6) This is the default method for many browsers

1) Data is appended to the URL.
2) Data is Secret
3) It is a two call system.
4) There is no Limit on the amount of data.That is characters any amount of data can be sent.
5) Data transmission is comparatively slow.
6) No default and should be Explicitly specified.