P
Piotr Nowak
Hi,
Im developing a RibbonBar Control in asp.net 1.1 by converting already
done in asp.net 2.0.
My problem is that theres no compositecontrol in 1.1. Correct me if im
wrong, heres what i want to achieve.
My RibbonButton control is a regular webcontrol. RibbonButton
instantiates a hiddenfield inside by creating new instance. So we have
simple situation here wheres RibbonControl that contains hiddenfield
control inside.
Note that aps.net 1.1 does not have hidden fields so i created my own
listed below:
public class SharedStateHiddenField : WebControl, IPostBackDataHandler
{
public string Value
{
get { return ViewState["Value"] != null ? (string)ViewState["Value"]
: string.Empty; }
set { ViewState["Value"] = value; }
}
protected override void AddAttributesToRender(HtmlTextWriter writer)
{
writer.AddAttribute(HtmlTextWriterAttribute.Id, ClientID);
writer.AddAttribute(HtmlTextWriterAttribute.Name, ClientID);
writer.AddAttribute(HtmlTextWriterAttribute.Value, Value);
writer.AddAttribute(HtmlTextWriterAttribute.Type, "hidden");
}
protected override HtmlTextWriterTag TagKey
{
get
{
return HtmlTextWriterTag.Input;
}
}
#region IPostBackDataHandler Members
public void RaisePostDataChangedEvent()
{
}
bool IPostBackDataHandler.LoadPostData(string postDataKey,
System.Collections.Specialized.NameValueCollection values)
{
return LoadPostData(postDataKey, values);
}
protected virtual bool LoadPostData(string postDataKey,
System.Collections.Specialized.NameValueCollection values)
{
string val = values[this.ClientID];
bool changed = false;
if (val != Value)
{
Value = val;
changed = true;
}
return changed;
}
#endregion
}
}
So, when i do postback on whatever control on my page, this
IPostBackDataHandler in my hidden field is not fired !
i want it to be fired and thats my question, why ?
Do you possibly know what is wrong ?
regards, Peter
Im developing a RibbonBar Control in asp.net 1.1 by converting already
done in asp.net 2.0.
My problem is that theres no compositecontrol in 1.1. Correct me if im
wrong, heres what i want to achieve.
My RibbonButton control is a regular webcontrol. RibbonButton
instantiates a hiddenfield inside by creating new instance. So we have
simple situation here wheres RibbonControl that contains hiddenfield
control inside.
Note that aps.net 1.1 does not have hidden fields so i created my own
listed below:
public class SharedStateHiddenField : WebControl, IPostBackDataHandler
{
public string Value
{
get { return ViewState["Value"] != null ? (string)ViewState["Value"]
: string.Empty; }
set { ViewState["Value"] = value; }
}
protected override void AddAttributesToRender(HtmlTextWriter writer)
{
writer.AddAttribute(HtmlTextWriterAttribute.Id, ClientID);
writer.AddAttribute(HtmlTextWriterAttribute.Name, ClientID);
writer.AddAttribute(HtmlTextWriterAttribute.Value, Value);
writer.AddAttribute(HtmlTextWriterAttribute.Type, "hidden");
}
protected override HtmlTextWriterTag TagKey
{
get
{
return HtmlTextWriterTag.Input;
}
}
#region IPostBackDataHandler Members
public void RaisePostDataChangedEvent()
{
}
bool IPostBackDataHandler.LoadPostData(string postDataKey,
System.Collections.Specialized.NameValueCollection values)
{
return LoadPostData(postDataKey, values);
}
protected virtual bool LoadPostData(string postDataKey,
System.Collections.Specialized.NameValueCollection values)
{
string val = values[this.ClientID];
bool changed = false;
if (val != Value)
{
Value = val;
changed = true;
}
return changed;
}
#endregion
}
}
So, when i do postback on whatever control on my page, this
IPostBackDataHandler in my hidden field is not fired !
i want it to be fired and thats my question, why ?
Do you possibly know what is wrong ?
regards, Peter