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
38
Other forums
Working with popups and such in a class
I've recently started building my applications completely enclosed in classes. I like the fact that
passthru() help
Hi everyone,
I'm new to the forum and to PHP. I have some pretty good experience writing shell sc
gmmktime or mktime
I live in the UK, i am within the GMT (with daylight saving time ie 1 hour difrence between summer a
set xml path in flash when xml created in memorystream and webrequest
i am creating an xml file using memory stream and i want to load this xml file into the flash on cli
Async WSAConnect failed on XP with error code = 2 ("File not found")
Hi all,
I have very strange bug, please help me if you can.
It is reproduced o
radio button reamains checked
Hello i'm trying to keep the state off my radio buttons so it shows which ones where clicked after t
Save username into DB
OkaY so I got my blog to actually save the posts and whatever, all I need now is for it to keep the
Warning: mysql_num_rows() supplied argument is not a valid MySQL result resource
This may be simple I just may need another pair of eyes..
When i get records back the below c
MASS PM
Hello all, I'm trying to send mass private messages to users in my database but keep getting an erro
PHP/Database issue
My friend is helping me make a database where you go to a certain webpage of my site and the page wi