locked
ASP.NET TextBox control and my Custom TextBox control RRS feed

  • Question

  • User-667042492 posted

    Hi,

    scenario : in a grid editing(orders grid), i use a usercontrol form in grid edit . in usercontrol form i have 2 textboxes that
    one of them is an asp.net textbox and other one is my custom textbox. also there is a grid in usercontrol too..
    the second grid (in usercontrol) has orderdetails.. when i add an item to orderdetails, then i compute totalamount of sale
    and set this text to my custom textbox and asp.net textbox..

    but the problem starts here.. asp.net textbox shows right value but my custom textbox shows old value, not computed value..
    i dont know why my custom textbox behaves like this? when i add my custom textbox to aspx page and change its text
    in form its works normal, but when i set a text from codebehind its not shows new text..

    How asp.net textbox feel its text changed in code behind? i think my custom textbox does not feel its text changed on codebehind..

    <cc1:MyTextBox ID="txtSalePrice" runat="server" Text="0" DataType="Money" Required="false" UseValidator="false" />

    thanks in advance..

    Sunday, May 18, 2008 12:55 PM

Answers

  • User-667042492 posted

    hi joteke,

     thank u for interest, but i solved the problem.. i was creating my custom text box in CreateChildControls, but when i create it in

    AddAttributesToRender method by using writer this problem solved.. i dont know how solved but its now working..

    when i set a text to my custom text box form codebehind, its goes to form correct.

     

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Monday, May 19, 2008 7:03 AM

All replies

  • User2032526919 posted

    Hi,

    Can you show how you have implemented the control? Mayube you have set the Text fixed to the point when it would be got from code-behing (basically too late from control lifecycle point of view)?

    I move this thread to Server Controls forum.

    Sunday, May 18, 2008 4:06 PM
  • User-667042492 posted

    hi joteke,

     thank u for interest, but i solved the problem.. i was creating my custom text box in CreateChildControls, but when i create it in

    AddAttributesToRender method by using writer this problem solved.. i dont know how solved but its now working..

    when i set a text to my custom text box form codebehind, its goes to form correct.

     

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Monday, May 19, 2008 7:03 AM