Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Adding ASP Textbox dynamically
Message
Information générale
Forum:
ASP.NET
Catégorie:
Autre
Divers
Thread ID:
00817593
Message ID:
00817702
Vues:
16
I think you have to use the Page_Load method, so that the added controls are available before the page is rendered.

>No, the code is in the click method of a button that is supposed to add a textbox.
>
>>Are you putting the code in the Page_Load() method?
>>
>>>I have been struggling with this problem all day yesterday and hope someone might suggest a solution or a web site to where solution might be.
>>>
>>>I want to dynamically add a ASP textbox to a Placeholder when user clicks on a button.
>>>
>>>The following code:
>>>
>>>
>>>txtTextBox = new TextBox();
>>>txtTextBox.ID = "txtProduct" + strFieldNum;
>>>PlaceHolder1.Controls.Add( txtTextBox );
>>>
>>>
>>>creates one textbox (and not ASP textbox). On the next button click, even though the value "strFieldNum" is incrementing, the same textbox just gets refreshed. How can I change the code to make it ASP textbox and to make it add new one every time.
>>>
>>>Any suggestions would be greatly appreciated.
Chris McCandless
Red Sky Software
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform