DataList Error

vellaima

Well-known member
Joined
Jan 29, 2003
Messages
109
Hi,

I tried to include templates in datagrid. But i am getting the error. Could anyone please help me out.

Code:

Code:
<asp:datagrid runat="server" id="table1">
     <asp:templatecolumn runat="server" id="template1">
          <itemtemplate>
               <asp:hyperlink runat="server" id="link1">Click Me</asp:hyperlink>
         </itemtemplate>
     <asp:templatecolumn>
</asp:datagrid>

The error i am getting is

Code:
Server Error in / Application.
--------------------------------------------------------------------------------

Parser Error 
Description: An error occurred during the parsing of a resource required to service this request. Please review the following specific parse error details and modify your source file appropriately. 

Parser Error Message: Type System.Web.UI.WebControls.DataGrid does not have a property named asp:templatecolumn.

Source Error: 


Line 39: <body>
Line 40:     <asp:datagrid runat="server" id="table1">
Line 41:      <asp:templatecolumn runat="server" id="template1">
Line 42:           <itemtemplate>
Line 43:                <asp:hyperlink runat="server" id="link1">Click Me</asp:hyperlink>
 

Source File: C:\Documents and Settings\Vidhya Rajaram\Desktop\CT\HardyOil\Original.aspx    Line: 41 


--------------------------------------------------------------------------------
Version Information: Microsoft .NET Framework Version:1.0.3705.0; ASP.NET Version:1.0.3705.0

Please help me out
 
Your problem is the case you have used for the properties for example: -

<asp:templatecolumn...> should be <asp:TemplateColumn...>
<asp:hyperlink...> should be <asp:HyperLink...>

check System.Web.UI.WebControls namespace for more details
 
Back
Top