In my website a user can send Greeting Cards to one or more than one person. For this, he will enter the Receiver name in one textbox and Receiver EmailId in another textboxand then click on "Send" button. If he wants to send more than one person then he will click on "Add More" button. when he cliks on "Add More" then two text boxes are created dynamically. one text box is for entering Receiver Name and another text box is for entering "Receiver Email Id". Each time when he clicks on "Add More" button then two text boxes are created. Please suggest me, how i will create two TextBoxes on each button click and get email id from these TextBoxes to send mail ob tthes mail id.
Loading
Anubhav ChaudharyPosted Dec 24, 2013, 4:10 AM
Swapnil MehtaPosted Jul 30, 2015, 2:17 AM
Vincent Maverick DuranoPosted Apr 28, 2015, 3:36 PM
Hi, Replying to old threads like this is considered as thread-jacking (http://www.mikesdotnetting.com/article/69/how-to-get-your-forum-question-answered-avoid-thread-jacking)- I'd suggest you to create your own thread so we can discuss your own issue there
To give you a quick answer then you can use a Panel control or PlaceHolder control to add control in a specific location in your page ~ for example:
PlaceHolder1.Controls.Add(TextBox);
Deepak RatanPosted Apr 28, 2015, 1:24 AM
Its creating on top of my page
I have to specific to that textbox where should place it
please help
This is my code:
protected void btncommand_Click(object sender, EventArgs e)
{
for (int i = 0; i <1; i++) //specifying the condition in for loop for creating no. of textboxes
{
TextBox tb = new TextBox(); //Create the object of TexBox Class
tb.ID = i.ToString(); // assign the loop value to textbox object for dynamically adding Textbox ID
Form.Controls.Add(tb); // adding the controls
}
}
Tirthak ShahPosted Dec 24, 2013, 4:48 AM
Try This Too
Anubhav ChaudharyPosted Dec 24, 2013, 4:14 AM
this code will come in .aspx.cs page:----