悬赏园豆:10
[已关闭问题]
<P>我写了一个控件Inherits TextBox,里面有一个复杂属性Tip,但每次postback的时候都说加载viewstate失败,除非我在!postback的情况下给Tip.xxx赋值.</P>
<P>下面我贴出代码,我已经搞了一天了,搞不出什么原因。</P>
<P mce_keep="true">using System;<BR>using System.Collections.Generic;<BR>using System.ComponentModel;<BR>using System.Text;<BR>using System.Web;<BR>using System.Web.UI;<BR>using System.Web.UI.WebControls;</P>
<P mce_keep="true">namespace Madou.WebControls<BR>{<BR> [DefaultProperty("Text")]<BR> [ParseChildren(true), PersistChildren(false)]<BR> [ToolboxData("<{0}:JTextBox runat=server></{0}:JTextBox>")]<BR> public class JTextBox : System.Web.UI.WebControls.TextBox<BR> {</P>
<P mce_keep="true"> public JTextBox()<BR> {<BR> BackColor = System.Drawing.Color.Beige;<BR> <BR> }</P>
<P mce_keep="true"> #region"Private"<BR> private ClipTipComponent _tip;<BR> #endregion</P>
<P mce_keep="true"> #region"定义属性"<BR> [Bindable(true)]<BR> [Category("Behavior")]<BR> [Description("Tip")]<BR> [DesignerSerializationVisibility(DesignerSerializationVisibility.Content)] <BR> [PersistenceMode(PersistenceMode.InnerProperty)]<BR> [NotifyParentProperty(true)]<BR> public virtual ClipTipComponent Tip<BR> {<BR> get<BR> {<BR> if (_tip == null)<BR> {<BR> _tip = new ClipTipComponent();<BR>
永不言败
|
菜鸟二级
|
园豆:
350
提问于:2008-02-03 12:48