err...
Allright...
The proble is with Comment.tTitle, it's always empty. Also my event hadler
DoSomething is never called.
And nowhere I'm writing tTitle.Text = "";, so how could it be?
something like that:
=== MyPage.aspx ===
........
<my:MyControl runat=server />
==MyControl.cs ==
class MyControl : Control, INamingContainer
{
Entry entry;
Comment comments;
protected override void CreateChildControls()
{
base.CreateChildControls();
Controls.Add(entry = new Entry());
ControlsAdd(comments = new Comment());
}
.......
}
== Entry.cs ==
class Entry : Control, INamingContainer
{
.....
}
== Comment.cs ==
class Comment : Control, INamingContainer
{
TextBox tTitle;
Button submit;
protected override void CreateChildControls()
{
base.CreateChildControls();
Controls.Add(tTitle = new TextBox());
tTitle.ID = "tTitle";
RequiredFieldValidator rfv = new RequiredFieldValidator();
rfv.ErrorMessage = "Required";
rfv.ControlToValidate = "tTitle";
Controls.Add(tTitle);
Controls.Add(submit = new Button());
submit.Text = submit;
submit.Clik += DoSomething();
......
}
void DoSomething(object sender, EventArgs e)
{
....
}
}
=============
"Teemu Keiski" <> wrote in message
news:uMAED%...
> Hi,
>
> can you post a small sample snippet to demonstrate what you are doing?
>
> --
> Teemu Keiski
> ASP.NET MVP, AspInsider
> Finland, EU
> http://blogs.aspadvice.com/joteke
>
> "Lloyd Dupont" <net.galador@ld> wrote in message
> news:...
>> On my web page I have a custom control developed in a C# library.
>> Somehow when I post the page, the user input disappears.
>> I override OnLoad() and check the value of my inputText.Text just before
>> and after base.OnLoad() and the user entered text never even seems to
>> reach my TextBox, although the ID property looks alright, and consistent.
>>
>> Any tips on how to investigate this bug? or what could be the cause of
>> it?
>>
>> --
>> I have taken a vow of poverty. If you want to really **** me off, send me
>> money.
>>
>>
>
>