L
Lin
I had create a web control that inherited from ListControl,
IPostBackDataHandler.
I implemeted the interface like this:
public virtual void RaisePostDataChangedEvent()
{
base.OnSelectedIndexChanged(EventArgs.Empty);
}
public virtual bool LoadPostData(string postDataKey, NameValueCollection
postCollection)
{
string postvalue=postCollection[this.UniqueID+"_Textbox"];
if (postvalue != null)
{
int i = base.Items.IndexOf(base.Items.FindByText(postvalue));
if (i < 0) return false;
if (base.SelectedIndex != i)
{
base.SelectedIndex = i;
return true;
}
}
return false;
}
But when I debug the code, the breakpoint that set in these code does not
effect. That means the code can not be executed. The postpack had no effect.
It's very strange.
Please tell me what's wrong with these code? Thanks.
IPostBackDataHandler.
I implemeted the interface like this:
public virtual void RaisePostDataChangedEvent()
{
base.OnSelectedIndexChanged(EventArgs.Empty);
}
public virtual bool LoadPostData(string postDataKey, NameValueCollection
postCollection)
{
string postvalue=postCollection[this.UniqueID+"_Textbox"];
if (postvalue != null)
{
int i = base.Items.IndexOf(base.Items.FindByText(postvalue));
if (i < 0) return false;
if (base.SelectedIndex != i)
{
base.SelectedIndex = i;
return true;
}
}
return false;
}
But when I debug the code, the breakpoint that set in these code does not
effect. That means the code can not be executed. The postpack had no effect.
It's very strange.
Please tell me what's wrong with these code? Thanks.