Inherited controls in datagrid template columns
-
Hi all, I have created inherited HyperLinkUser control as follows
Public Class ResourceHyperLink
Inherits HyperLink
Private m_ResourceID As Integer
Private m_ResouceName As StringPublic Property ResourceName() As String Get ResourceName = m\_ResouceName End Get Set(ByVal Value As String) m\_ResouceName = ResourceName End Set End Property Public Property ResourceID() As String Get ResourceID = m\_ResourceID End Get Set(ByVal Value As String) m\_ResourceID = ResourceID End Set End Property End Class
Can I able to add this control in the datagrid Itemtemplate
asp:TemplateColumn
<ItemTemplate>
'HERE </ItemTemplate>
</asp:TemplateColumn> -
Hi all, I have created inherited HyperLinkUser control as follows
Public Class ResourceHyperLink
Inherits HyperLink
Private m_ResourceID As Integer
Private m_ResouceName As StringPublic Property ResourceName() As String Get ResourceName = m\_ResouceName End Get Set(ByVal Value As String) m\_ResouceName = ResourceName End Set End Property Public Property ResourceID() As String Get ResourceID = m\_ResourceID End Get Set(ByVal Value As String) m\_ResourceID = ResourceID End Set End Property End Class
Can I able to add this control in the datagrid Itemtemplate
asp:TemplateColumn
<ItemTemplate>
'HERE </ItemTemplate>
</asp:TemplateColumn>danasegaranea wrote:
Can I able to add this control in the datagrid Itemtemplate
Yes you can do that. What's the problem you are facing here ?
All C# applications should call Application.Quit(); in the beginning to avoid any .NET problems.- Unclyclopedia My Website | Ask smart questions
-
danasegaranea wrote:
Can I able to add this control in the datagrid Itemtemplate
Yes you can do that. What's the problem you are facing here ?
All C# applications should call Application.Quit(); in the beginning to avoid any .NET problems.- Unclyclopedia My Website | Ask smart questions
Thanks for the post Navaneeth, I tried like this
asp:TemplateColumn
<ItemTemplate>
<asp:ResourceHyperLink ID="lblResource_First" Runat="server" Text='<%# DataBinder.Eval(Container.DataItem, "ResourcesName_Left") %>' BorderColor="white" >
</asp:ResourceHyperLink>
</ItemTemplate>
</asp:TemplateColumn>And got the error as The active schema doesnot support
-
Thanks for the post Navaneeth, I tried like this
asp:TemplateColumn
<ItemTemplate>
<asp:ResourceHyperLink ID="lblResource_First" Runat="server" Text='<%# DataBinder.Eval(Container.DataItem, "ResourcesName_Left") %>' BorderColor="white" >
</asp:ResourceHyperLink>
</ItemTemplate>
</asp:TemplateColumn>And got the error as The active schema doesnot support
Have you tried putting a simple text value ? Remove
DataBinder.Eval(Container.DataItem, "ResourcesName_Left")
and put a simple text there. Just check if it is working ?All C# applications should call Application.Quit(); in the beginning to avoid any .NET problems.- Unclyclopedia My Website | Ask smart questions
-
Have you tried putting a simple text value ? Remove
DataBinder.Eval(Container.DataItem, "ResourcesName_Left")
and put a simple text there. Just check if it is working ?All C# applications should call Application.Quit(); in the beginning to avoid any .NET problems.- Unclyclopedia My Website | Ask smart questions
I tried like this
<ItemTemplate>
<asp:ResourceHyperLink ID="lblResource_First" Runat="server" Text='My' BorderColor="white" >
</asp:ResourceHyperLink>
</ItemTemplate>
asp:TemplateColumnand got the error as
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: Could not load type System.Web.UI.WebControls.ResourceHyperLink from assembly System.Web, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a.
Source Error:
Line 322: asp:TemplateColumn
Line 323: <ItemTemplate>
Line 324: <asp:ResourceHyperLink ID="lblResource_First" Runat="server" Text='My' BorderColor="white" >
Line 325: </asp:ResourceHyperLink>
Line 326: </ItemTemplate> -
I tried like this
<ItemTemplate>
<asp:ResourceHyperLink ID="lblResource_First" Runat="server" Text='My' BorderColor="white" >
</asp:ResourceHyperLink>
</ItemTemplate>
asp:TemplateColumnand got the error as
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: Could not load type System.Web.UI.WebControls.ResourceHyperLink from assembly System.Web, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a.
Source Error:
Line 322: asp:TemplateColumn
Line 323: <ItemTemplate>
Line 324: <asp:ResourceHyperLink ID="lblResource_First" Runat="server" Text='My' BorderColor="white" >
Line 325: </asp:ResourceHyperLink>
Line 326: </ItemTemplate>It looks like you haven't registered your control assembly. So default ASP.NET will look in
System.Web.UI.WebControls
and throws this error. Add the below tag to top of your page.<%@ Register Assembly="AssemblyName" Namespace="YourNameSpace" TagPrefix="cc1" %>
In your sample, call this like
<cc1:ResourceHyperLink ID="lblResource_First" Runat="server" Text='My' BorderColor="white" > </cc1:ResourceHyperLink>
All C# applications should call Application.Quit(); in the beginning to avoid any .NET problems.- Unclyclopedia My Website | Ask smart questions