0

Hello i have a calculations page and has many textboxes created dynamically. What i want to do is when the first textbox value changed, change the others code behind without using javascript or events. Is there any way to bind textBoxes like this.

Thnx

Ex.Code that i use

tb = new TextBox()
{
    ID = String.Format("tb_{0}_{1}_{2}_{3}", x, y, z, i),
    Width = 130,
    TextMode = TextBoxMode.Number,
    Text = ((TextBox)(Master.FindControl("ContentPlaceHolder1").FindControl(String.Format("tb_{0}_{1}_{2}", x, y, z)))).Text.ToString()
};

There is link for sample view for textboxes http://oi61.tinypic.com/2hd8f8p.jpg

  • why do you want to do this without javascript? – Jonesopolis Apr 25 '14 at 12:29
  • What you're asking for makes no sense. You can only change other controls by **using** javascript and/or events. – freefaller Apr 25 '14 at 12:31
  • processing each key press in a code behind to update the other text box would require an event as well as a post back for each key press. Clearly this is not desirable. – Nick Apr 25 '14 at 12:32
  • I know there is window controls binding for this, but want to know any binding for web controls – user3572709 Apr 25 '14 at 13:21

1 Answers1

0

I suppose you would have to set AutoPostBack to true on the textbox, and handle the OnTextChanged event. When the user changes the text of the textbox and leaves the textbox, the page should perform a postback, allowing you to handle this event. To my knowledge, this is the closest you can get without JavaScript.

If you don't want events either.. then... this is impossible..

ewitkows
  • 3,528
  • 3
  • 40
  • 62