Dynamic Server Control event handling
Please support our ASP.NET advertiser: DiscountASP.NET – 3 Months Free on ASP.NET 3.5/2.0 Web Hosting
![]() |
•
•
Posts: 10
Reputation:
Solved Threads: 1
Hi All,
Please help me to complete the following type of event handling in asp.net with C#
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
Please help me to complete the following type of event handling in asp.net with C#
C# Syntax (Toggle Plain Text)
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
Last edited by vimalfor5 : Nov 24th, 2008 at 11:11 am. Reason: mistake correction
•
•
Posts: 10
Reputation:
Solved Threads: 1
Hi Serkan,
The code structure is like
PageLoad -> above method ->
The code structure is like
PageLoad -> above method ->
c# Syntax (Toggle Plain Text)
protected void Text_Changed(object sender,EventArgs e) { TextBox t1 =null; t1 = (TextBox)sender; ...... ...... }
Last edited by vimalfor5 : Nov 24th, 2008 at 4:32 pm.
•
•
Posts: 1,157
Reputation:
Solved Threads: 133
i believe when you are creating the controls dynamically like that, the control is not there that signaled the event
http://gregmckinley.com/cs/blog/arch.../09/29/27.aspx
http://gregmckinley.com/cs/blog/arch.../09/29/27.aspx
Custom Application & Software Development
www.houseshark.net
www.houseshark.net
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.
Serkan Sendur
All my helpful posts are dedicated to Marty Friedman, especially for his song Forbidden City.
All my helpful posts are dedicated to Marty Friedman, especially for his song Forbidden City.
•
•
Posts: 10
Reputation:
Solved Threads: 1
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..
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..
![]() |
Other Threads in the ASP.NET Forum
- Previous Thread: IE7/saving pages problem
- Next Thread: application extension problem
•
•
•
•
Views: 1452 | Replies: 6 | Currently Viewing: 1 (0 members and 1 guests)






Linear Mode