Describe the difference between inline and code behind -
which is best in a loosely coupled solution Tightly coupled
- INLINE

Answer Posted / m.sivakumar

Difference between inline and code behind - which is best?


Answers:
Inline code written along side the html in a page. Code-behind is code written in a separate file and referenced by the .aspx page.



Inline Code:- Inline Code written along side the HTML in a page.

Code Behind:- Code Behind is simply a separate code file linked to your web form or .aspx page. Code is stored in separate file which is identified by a .cs suffix or .vb suffix.

Code Behind is the best.
Because:-
Separation of the content from the code. It is practical to have a designer working on a markup while a programmer writes code.

Is This Answer Correct ?    3 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Why does my asp.net file have multiple tag with runat=server?

655


Hello, Using Visual Studio 2005 (VB) I am working to create a Web Site implementing the following: Within a gridView I have placed a dropdownlist control with a DataSourceID="SDSLkupList". SDSLkupList is a sqlDataSource used to store a lookup list for dropdownlist translation from ID to text. SDSLkupList contains the translation text and other fields related to the dropdown selection ID. (Thought it would be efficient to get everything at the same time.) I would like to provide the user the ability to select from the dropdownlist and, based on the selection, use labels to list related columns stored on the SDSLkupList in separate gridView columns. I have read that SqlDataSources are not meant to be used for individual controls. Since SDSLkupList contains all related information, is there a way to do a find using the dropdownlist selectedValue? (I was not able to discover one.) Otherwise, what should I use? It would need to set the labels on the gridView DataRowBound event as well as the SelectedIndexChanged events. Has anyone done this? Any help would be appreciated. Thanks in Advance. Neal

1472


What is application Object?

676


Why is string called immutable data type?

689


If you are using components in your application, how can you handle exceptions raised in a component?

2171






What is DataGrid wheater its a Server Control or something else ?

685


what is silver light when will we use silver light,

1544


What is difference between asp state management and asp.net state management? How can we pass info between 2 asp.net pages?

572


What are validator? Name the validation controls in asp.net?

596


What is http session state?

598


What is Web API Routing?

686


What is tracing? Where is it used?

669


What would be salary for 8+ years of experience in ASP.NET in different metro city in india?

2077


What are the best practices to follow to secure connection strings in an ASP.NET web application?

646


What is the difference between session and application?

587