Multipe Dynamic Controls & AutoPostback Issue


Posted on 16th Feb 2014 07:03 pm by admin

I currently have a need to create many dynamic controls (Example Textboxes) that need to do a PostBack upon the data in the control changing (Autopostback = true). The following sample code demononstrates the example. When the code is executed, I can click on a control, enter in some text, and then hit the tab key (not concerned about the focus issue here), If I then click on another control enter in some text again and hit tab again, (postback issued again). It now at this point jumps to the next control, and seems to be non functional. No text can be entered. I click on another control, that control gains focus, but still can not enter in any text. I can't figure out what is going on. view plaincopy to clipboardprint?public partial class _Default : System.Web.UI.Page { protected void Page_Load(object sender, EventArgs e) { for (int x = 0; x < 30; x++) { TextBox Test = null; Test = new TextBox(); Test.ID = x.ToString(); Test.AutoPostBack = true; MyHolder.Controls.Add(Test); } } } public partial class _Default : System.Web.UI.Page { protected void Page_Load(object sender, EventArgs e) { for (int x = 0; x < 30; x++) { TextBox Test = null; Test = new TextBox(); Test.ID = x.ToString(); Test.AutoPostBack = true; MyHolder.Controls.Add(Test); } } }
view plaincopy to clipboardprint?<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="TestAjax._Default" %> Untitled Page
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="TestAjax._Default" %> Untitled Page

Any Help would be GREATLY APPRECIATED - Driving me nuts!

No comments posted yet

Your Answer:

Login to answer
123 Like 38 Dislike
Previous forums Next forums
Other forums

rdns with php
I am trying to build a script that will show all of the different domains that are hosted on the sam

couldn't connect to your database
Hello I am new to php mysql

Actually i have read A tutorial on nettuts
"http://net.tu

Not "Just Another" MMORPG - text based.
Hello,

I've been learning MySQL and PHP for the last 2-3 years.
Though, I've had long paus

setcookie and isset($_COOKIE(name)) seem very finnicky.
I'm currently playing around with a user system with login and registration. I'm trying to use cooki

finding key position of specified value in multi-dimensional array
Code: $openedfile = fopen($tfc_file4, "r");
$rc = 1;
while(!feof($openedfile))
{<

how to read and write into a word document using php...?
hi,
I need,reading and writting into a word document using php.




Thank u inadva

Google Map
I have done Google Map Integration for one my project. But for that we need the "latitude and l

question about n
I was looking at some of the things you could do with php and one of the things I have tried is n.<

a multi dimensional array with for each
hi, I have been asked to write an array, I have Zone 2,3,4,5,6,7,8 each zone has 3 sections of weigh

unexpected T_SL without a shift left token
Nothing too see here, I'm an idiot and resolved the problem.

Sign up to write
Sign up now if you have flare of writing..
Login   |   Register
Follow Us
Indyaspeak @ Facebook Indyaspeak @ Twitter Indyaspeak @ Pinterest RSS



Play Free Quiz and Win Cash