473,473 Members | 1,800 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Dynamic generated TextBox

I have posted this message 15 hours ago but I still could not seeit. So I decide repost it.

I have successully used Jeffrey Ton's method to generate dymanicTextBox. Now my problem is that After the textbox show firsttime, I changed the text of textbox. I WANT to use thes new textin the textbox. But since the textbox showed second time is newgenerated, or say new populated.

So how could I use the new Text in textBox?

Thanks.

Chen

-----------------------
Posted by a user from .NET 247 (http://www.dotnet247.com/)

<Id>21Paqw17vU2hDwxSLOnfuw==</Id>
Nov 18 '05 #1
1 1200
Hi,

1) You need to recreate your dynamic control each time page recreate
(even in postback).

2) If you want to use dynamic control value from page load event you
need to create dynamic control in page OnInit.

override protected void OnInit(EventArgs e)
{
TextBox oTxt = new TextBox();
oTxt.Visible = true;
oTxt.ID = "oNat";
this.FindControl("Form1").Controls.Add(oTxt);
.....

private void Page_Load(object sender, System.EventArgs e)
{
string s = ((TextBox)this.FindControl("oNat")).Text;
}

HTH
Natty Gur[MVP]

blog : http://weblogs.asp.net/ngur
Mobile: +972-(0)52-8888377
*** Sent via Devdex http://www.devdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 18 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: Terri | last post by:
I have a form with a multi-select combo. I dynamically build a SELECT statement, open a report, and set the recordsource to my dynamic SELECT statement. I count the records returned in the report...
9
by: wASP | last post by:
Hello again to all of you geniuses, I'm having a problem trying to load dynamic controls at the initialization phase. I've read the docs, and I thought I had it figured out:...
6
by: hb | last post by:
Hi, I have a page bill.aspx and its code-behind bill.aspx.cs. On bill.aspx I have: === Select a month: <asp:dropdownlist runat="server" id="lstDate" autopostback="True" /> <br> <asp:table...
6
by: dhnriverside | last post by:
Hi peeps, I'm trying to create some controls textboxes at runtime, based on the number of items in a IETreeView that are checked. That I can do, I've got a place holder and I can create the...
12
by: scottrm | last post by:
Is there a way to generate a list of say textbox controls dynamically at run time, based on say a value coming out of a database which could vary each time the code is run. In traditional asp you...
1
by: Kum | last post by:
Hi, I need help in asp.net dynamic textbox controls validation. I am creating textbox controls dynamically on a asp.net webpage. Now after creating the textboxes on the page I want to validate...
1
by: Danny | last post by:
Hi, I've create a usercontrol with a Calendar Control and a Textbox. The SelectionChanged event of the calendar populates the textbox with the selected date. Also, I've created an aspx...
1
by: arunguptadch | last post by:
i have to create a form like reservation of railways but different is that where we entered name, age,male, choice all these item is generated when we click the button ie there is a text box when we...
2
by: Peted | last post by:
Can anyone suggest a best practice approach to building a dynamic winforms UI. Just as an example somehting like a billing application where you enter a customer billing data and the billing...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.