losing data

Discussion in 'ASP .Net' started by Lloyd Dupont, Feb 11, 2006.

  1. Lloyd Dupont

    Lloyd Dupont Guest

    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 piss me off, send me
    money.
    Lloyd Dupont, Feb 11, 2006
    #1
    1. Advertising

  2. Lloyd Dupont

    Lloyd Dupont Guest

    Really weird...
    I have setup an event listener to the Load event of my text box and its Text
    propert is still ""
    although I have also checked Context.Request.Params[tTitle.UniqueID] and it
    does contains the user value....
    how comes my TextBox's Text is not updated?
    Any ideas?

    "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 piss me off, send me
    > money.
    >
    >
    Lloyd Dupont, Feb 11, 2006
    #2
    1. Advertising

  3. Lloyd Dupont

    Teemu Keiski Guest

    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 piss me off, send me
    > money.
    >
    >
    Teemu Keiski, Feb 11, 2006
    #3
  4. Lloyd Dupont

    Lloyd Dupont Guest

    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 piss me off, send me
    >> money.
    >>
    >>

    >
    >
    Lloyd Dupont, Feb 11, 2006
    #4
  5. Lloyd Dupont

    Lloyd Dupont Guest

    Found it, I add some control without ID and that was, somehow, causing the
    problem....

    "Lloyd Dupont" <net.galador@ld> wrote in message
    news:%...
    > I'm narrowing on the culprit.
    > I have an HideBox control (attached) and it is those TextBox inside it
    > which are loosing data.
    > I have yet to figure out why...
    >
    > "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 piss me off, send me
    >> money.
    >>
    >>

    >
    >
    >
    Lloyd Dupont, Feb 11, 2006
    #5
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Victor Garcia Aprea [MVP]

    Re: Losing Form data

    Victor Garcia Aprea [MVP], Jun 25, 2003, in forum: ASP .Net
    Replies:
    0
    Views:
    908
    Victor Garcia Aprea [MVP]
    Jun 25, 2003
  2. Mark MacRae

    Re: Session Losing Data

    Mark MacRae, Jul 18, 2003, in forum: ASP .Net
    Replies:
    0
    Views:
    357
    Mark MacRae
    Jul 18, 2003
  3. Brad
    Replies:
    3
    Views:
    1,868
    Steven Cheng[MSFT]
    Feb 19, 2004
  4. et
    Replies:
    6
    Views:
    5,722
  5. Jason C
    Replies:
    4
    Views:
    679
    Morty Abzug
    Jun 26, 2012
Loading...

Share This Page