473,786 Members | 2,775 Online
Bytes | Software Development & Data Engineering Community
+ 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>21Paqw17vU2 hDwxSLOnfuw==</Id>
Nov 18 '05 #1
1 1215
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(EventArg s e)
{
TextBox oTxt = new TextBox();
oTxt.Visible = true;
oTxt.ID = "oNat";
this.FindContro l("Form1").Cont rols.Add(oTxt);
.....

private void Page_Load(objec t sender, System.EventArg s e)
{
string s = ((TextBox)this. FindControl("oN at")).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
8304
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 by setting a text box to =Count(*). This works fine. Now I want to count the unique records in my report. I can dynamically create a SELECT statement that counts unique records. My statement looks like this: SELECT DISTINCT...
9
17631
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: <>-<>-<>-<>-<>-<>-<>-<>-<>-<>-<>-<> <>-<>-<>-<>-<>-<>-<>-<>-<>-<>-<>-<> .NET Framework Class Library Control.Init Event
6
2653
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 runat="server" id="tabBill" /> <br>
6
2238
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 corrent number of controls. The problem is that they appear next to each other. I want to create the controls with some wording to the left of them (again, dynamically generated). Normally id use <table> with two colums, one for the
12
1499
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 could just have run a loop to do something like that. I am aware in you can use something like Form1.Controls.Add(TextBox1) to add textboxes dynamically at run time but you still need to declare each individual textbox control as far as I can...
1
1964
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 these text boxes when the user submits or posts back to the server. My intention was to create a textboxvalidator function which takes the control name as argument and returns an true if
1
1126
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 page with an ASP Table on the page.
1
839
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 entered a value on text box just like 3 then three row are generated with all rows having three textbox ie if there is4 field then 4*4 textbox generated and after that i have to save value to data base
2
5960
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 options, the UI and the winform controls you have visible are dynamic and can change as information is entered, so that there is a dependency between between the data you enter and how other controls react, and/or are even selectable
0
10363
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10164
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
9962
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8992
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7515
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6748
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5398
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 last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
4067
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3670
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.