Hi All,

Please help me to complete the following type of event handling in asp.net with C#

private TableCell CreateTextCell(string name,string id)
{
   TableCell cell = new TableCell();
   TextBox txt = new TextBox();
   txt.ID = id;
   txt.AutoPostBack = true;
   txt.Text = name;
   txt.TextChanged += new System.EventHandler(this.txt_Changed);
   cell.Controls.add(txt);
   return cell;
}

My Problem is the TextChanged event is not calling or it is not properly handling.. the autopostback is working fine.. but the event handler not..
and one thing I'm using .net 1.1 version in VS2003

Please give me a suggestion

Vimal

where is your txt_changed method? what is the problem?

Hi Serkan,

The code structure is like
PageLoad -> above method ->

protected void Text_Changed(object sender,EventArgs e)
{
   TextBox t1 =null;
  t1 = (TextBox)sender;
......
......
}

ok, there is one big difference between .net framework 1.1 and 2.0, in 1.1 you have to wire the events to the methods in the page init event handler. Tell me what exactly you want to do with these table cells. Watch the execution order of events during the page cycle. that is the most typical problem for such issues.

Hi

Actually i want to update some other cells + Some calculations also there whenever the dynamically created text field changed, thats the main thing i want to do. Coz the each and every cell in that page is dynamically created. I Have tried alot to do that Event handling.
I dnt want to use Ajax features in this app.
i knows the limitations of 1.1 and to 2.0 ...
Now i', trying the same thing with the JavaScript..

yeah your best bet would be javascript.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.