Click here to Skip to main content
15,890,579 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,
i have asp.net web application in which i used to generate list of text boxes depend on count in table dynamically.however whenever I load the details I am getting the same output in the TextBox every time.

please help.

What I have tried:

after generating all controls(TextBox,dropdownlist etc) i am doing this below

TextBox txtRes1 = (TextBox)PlaceHolder1.FindControl("id1");
txtRes1.Text= concat(value1, valu2);

public int concat(strin v1, string v2)
{
return v1+v2;
}
Posted
Updated 21-Feb-16 19:45pm
v3
Comments
CHill60 21-Feb-16 7:44am    
Are you checking for post-back in your page load?
Merajuddin Ansari 21-Feb-16 8:00am    
no..if i do !IsPostBack then on autopostback no textbox will be created.

http://stackoverflow.com/questions/9495175/update-dynamically-created-textbox-in-c-sharp-and-asp-net

http://stackoverflow.com/questions/14327729/asp-net-change-update-dynamically-created-textbox
CHill60 21-Feb-16 9:42am    
I only came across your comment by accident - if you want someone to be notified that you are replying then use the "Reply" link on their post.
You need to share your page load code.

1 solution

C#
Thanks guys.
i got the solution for this by creating a TextChanged event of a textbox in which i wanted to put the new changed value.

protected void TextBox1_TextChanged(object sender, EventArgs e)
{
string endDate = Request.Form[((TextBox)PlaceHolder1.FindControl("tb1")).UniqueID];
                                    string startDate = Request.Form[((TextBox)PlaceHolder1.FindControl("tb2")).UniqueID];

TextBox txtRes = (TextBox)PlaceHolder1.FindControl("tb31");
txtRes.Text = tbc.DateDiff(Convert.ToDateTime(endDate), Convert.ToDateTime(startDate));
}
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month


CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900