Click here to Skip to main content
15,901,122 members
Home / Discussions / C#
   

C#

 
AnswerRe: A simple example using a USB plug and unplug (to next plugin) condition... Pin
Eddy Vluggen10-Dec-14 7:35
professionalEddy Vluggen10-Dec-14 7:35 
QuestionReg. Regular Expression Pin
Dhimant B10-Dec-14 2:51
Dhimant B10-Dec-14 2:51 
AnswerRe: Reg. Regular Expression Pin
OriginalGriff10-Dec-14 3:05
mveOriginalGriff10-Dec-14 3:05 
GeneralRe: Reg. Regular Expression Pin
Dhimant B10-Dec-14 18:58
Dhimant B10-Dec-14 18:58 
GeneralRe: Reg. Regular Expression Pin
OriginalGriff11-Dec-14 0:21
mveOriginalGriff11-Dec-14 0:21 
SuggestionRe: Reg. Regular Expression Pin
Matt T Heffron11-Dec-14 8:34
professionalMatt T Heffron11-Dec-14 8:34 
SuggestionRe: Reg. Regular Expression Pin
Matt T Heffron11-Dec-14 15:33
professionalMatt T Heffron11-Dec-14 15:33 
SuggestionRe: Reg. Regular Expression Pin
Matt T Heffron11-Dec-14 8:35
professionalMatt T Heffron11-Dec-14 8:35 
AnswerRe: Reg. Regular Expression Pin
Agent__00710-Dec-14 21:07
professionalAgent__00710-Dec-14 21:07 
AnswerRe: Reg. Regular Expression Pin
Matt T Heffron12-Dec-14 7:04
professionalMatt T Heffron12-Dec-14 7:04 
GeneralRe: Reg. Regular Expression Pin
jschell12-Dec-14 12:08
jschell12-Dec-14 12:08 
QuestionRevit macro with if/else command Pin
William Wydock9-Dec-14 11:15
William Wydock9-Dec-14 11:15 
AnswerRe: Revit macro with if/else command Pin
BillWoodruff9-Dec-14 14:21
professionalBillWoodruff9-Dec-14 14:21 
AnswerRe: Revit macro with if/else command Pin
Eddy Vluggen10-Dec-14 0:32
professionalEddy Vluggen10-Dec-14 0:32 
Questionplease help me solve a nested dictionary structure problem!!! (here is a sample code where am i doing wrong) Pin
gajanangan9-Dec-14 7:22
gajanangan9-Dec-14 7:22 
SuggestionRe: please help me solve a nested dictionary structure problem!!! (here is a sample code where am i doing wrong) Pin
gaurigan9-Dec-14 16:17
gaurigan9-Dec-14 16:17 
QuestionRe: please help me solve a nested dictionary structure problem!!! (here is a sample code where am i doing wrong) Pin
Richard MacCutchan9-Dec-14 22:15
mveRichard MacCutchan9-Dec-14 22:15 
AnswerSolved :please help me solve a nested dictionary structure problem!!! (here is a sample code where am i doing wrong) Pin
gaurigan10-Dec-14 13:56
gaurigan10-Dec-14 13:56 
Questionproblem finding control and getting its values for dynamically created textboxes Pin
Dhyanga9-Dec-14 5:34
Dhyanga9-Dec-14 5:34 
Hi,

I have a situation where I need to show data from database to textboxes. These textboxes has to be dynamically created and can be editable. I am able to create textboxes as follows:
C#
string[] myData = liD1.ToArray(); //liD1 is a list that has values from database
public void showData()
{
	for (int i = 0; i < myData.Length; i++)
	{
		if (txtMore.FindControl("txtD1StartTime" + i) == null)
		{
			txtStart1 = new TextBox();
									 
			lblStart1 = new Label();
								   
			txtStart1.ID = "txtD1S" + i;
									 
			lblStart1.ID = "lblD1S" + i;
									  
			txtStart1.Text = myData[i].ToString();
										
			lblStart1.AssociatedControlID = txtStart1.ID;
			
			lblStart1.Text = "Data" + i;
								 
			txtMore.Controls.Add(lblStart1);
			
			txtMore.Controls.Add(txtStart1);
						  
		}
	}
}

In my ascx page, I am loading those textboxes in

as follows:
C#
<ul class="txtMore" id="txtMore"  runat="server">
                                          
 </ul>

showData() function is loading data with dynamically created textboxes. This is working fine. Now If i edit textboxes and try to get new data, it is not giving me anything. Actually it couldn't even find that control. Code is as shown below:

C#
public void getData()
{
	for (int i = 0; i < myData.Length; i++)
	{
		TextBox t = txtMore.FindControl("txtD1S" + i) as TextBox;
		
		if (t != null)
		{
			string temp = t.Text;
        }
	}
}


Even though I have dynamically loaded textboxes from showData(), in getData(),it is not able to find any control. Please help.
Dhyanga

SuggestionRe: problem finding control and getting its values for dynamically created textboxes Pin
Richard Deeming9-Dec-14 6:34
mveRichard Deeming9-Dec-14 6:34 
Questiontrouble to allocate/read buffer modified by native function Pin
Member 111038219-Dec-14 0:20
Member 111038219-Dec-14 0:20 
AnswerRe: trouble to allocate/read buffer modified by native function Pin
Richard MacCutchan9-Dec-14 6:08
mveRichard MacCutchan9-Dec-14 6:08 
QuestionTime out Expires while generating report. Pin
Pushpak Shah8-Dec-14 20:44
professionalPushpak Shah8-Dec-14 20:44 
QuestionRemote powershell / WinRM to Server 2012 Pin
JD868-Dec-14 18:49
JD868-Dec-14 18:49 
SuggestionRe: Remote powershell / WinRM to Server 2012 Pin
Richard MacCutchan8-Dec-14 22:07
mveRichard MacCutchan8-Dec-14 22:07 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.