what r the Templeats in ASP.net?

Answer Posted / smriti

The repeater,Datalist,Datagrid are templated controls in
asp.net

Generally speaking, a template is the description of how a
certain element will be rendered at runtime. In ASP.NET, a
template is property of a server control that describes the
static HTML, controls, and script to render within one
region of the control. For example, a Repeater control has
a HeaderTemplate property that defines the contents of its
header region. You normally define a template within the
body of an ASP.NET page using declarative syntax. For
example, the following code shows how to specify a template
to draw the header and each row of a Repeater control.
<asp:repeater runat="server">
<HeaderTemplate>
<h2>Employees</h2>
<table border="0">
</HeaderTemplate>

<ItemTemplate>
<tr>...</tr>
</ItemTemplate>
</asp:repeater>
When it comes to rendering the contents of the Repeater
control, the ASP.NET runtime uses the content defined in
the templates and processes it?often together with bound
data?to create an HTML representation of the region. All
the server-side controls within the template individually
render themselves as HTML.
The Microsoft? .NET Framework utilizes the ITemplate
interface at runtime to process the templates into a
control hierarchy that can be databound and rendered to
populate a part of an ASP.NET control. As long as you
define templates in a declarative manner?using inline tags
in ASPX pages?you don't strictly need to know about the
ITemplate interface. That will become important only when
you move one step further and start investigating how to
create and assign templates programmatically and
dynamically. But before we look at that, let's review the
use of templates with a DataGrid control.

Is This Answer Correct ?    1 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Is asp.net 64-bit enabled? How?

595


What is asp.net response object?

564


Is razor a programming language?

535


Mention the execution process for managed code?

539


What is query string? What are its advantages and limitations?

516






What is a web api?

555


i have 3+ exp in .net? i am going interview now but they asked me do you know any TOOL? which tool will i study please refer me?

1847


What is a global postback url?

516


How to disable validator control by client side JavaScript?

576


Can you change a master page dynamically at runtime? How?

511


Web API supports which protocol?

860


What is the file through which you can customize your asp.net application?

551


Explain exception filters?

593


Suppose you want an asp.net function (client side) executed on the mouseover event of a button. Where do you add an event handler?

569


How can we identify that the page is post back in asp net?

518