-Dman100-
asked on
bind to label or literal control
I have a user control with two label controls. Is it possible to databind to a label or literal control either declaratively or programmatically?
I was trying to bind using the Eval expression in the text attribute, but that doesn't work. I think that has to be within a databound control like gridview, formview, detailsview, etc.
Any help is greatly appreciated.
I was trying to bind using the Eval expression in the text attribute, but that doesn't work. I think that has to be within a databound control like gridview, formview, detailsview, etc.
Any help is greatly appreciated.
<%@ Control Language="C#" AutoEventWireup="true" CodeFile="Quotes.ascx.cs" Inherits="controls_Quotes" %>
<asp:Label ID="Label1" runat="server" Text='<%# Eval("quote_text") %>'></asp:Label>
<asp:Label ID="Label2" runat="server" Text='<%# Eval("quote_author") %>'></asp:Label>
<asp:ObjectDataSource ID="ObjectDataSource1" runat="server"
OldValuesParameterFormatString="original_{0}" SelectMethod="getQuotes"
TypeName="Library.BLL.QuotesBL"></asp:ObjectDataSource>
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.