Bidning control

A

Anton

I create simple control.
namespace DatePick
{

[DefaultProperty("Text")]
[ToolboxData("<{0}:DatePick runat=server></{0}:DatePick>")]
public class DatePick : TextBox
{
[Bindable(true)]
[Category("Appearance")]
[DefaultValue("")]
[Localizable(true)]
public string Text
{
get
{
String s = (String)ViewState["Text"];
return ((s == null) ? String.Empty : s);
}

set
{
ViewState["Text"] = value;
}
}
}
}
register it <%@ Register Namespace="DatePick" Assembly="DatePick"
TagPrefix="Custom"%>, works fine , but when I attempt to bind it get
error it temporary file:

<Custom:DatePick ID="DatePick1" runat="server" Text='<%#
DataBinder.Eval(Container.DataItem, "Text") %>' ></Custom:DatePick>

The type name 'DatePick' does not exist in the type 'DatePick.DatePick'

public void @__DataBinding__control21(object sender, System.EventArgs
e) {
(ERROR HERE )DatePick.DatePick dataBindingExpressionBuilderTarget;
System.Web.UI.IDataItemContainer Container;
dataBindingExpressionBuilderTarget = ((DatePick.DatePick)(sender));
Container =
((System.Web.UI.IDataItemContainer)(dataBindingExpressionBuilderTarget.BindingContainer));

what is wrong?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,774
Messages
2,569,596
Members
45,130
Latest member
MitchellTe
Top