Problem in Dynamically Created Table row [modified]
-
Hi, I have a asp:table on aspx Page. Im adding dynamic rows to the table. The rows added dynamically are visible on the UI bt im unable to find those dynamically created rows in viewsource of the page. i.e they are not being rendered. I want to access controls value inside the table cell. i have added textbox control in the table cell whose value i want to calculate. How i can do that. Thank you all for your replies.
modified on Monday, April 13, 2009 4:51 AM
-
Hi, I have a asp:table on aspx Page. Im adding dynamic rows to the table. The rows added dynamically are visible on the UI bt im unable to find those dynamically created rows in viewsource of the page. i.e they are not being rendered. I want to access controls value inside the table cell. i have added textbox control in the table cell whose value i want to calculate. How i can do that. Thank you all for your replies.
modified on Monday, April 13, 2009 4:51 AM
Could you post here your line code way of inding the controls ?
Parwej Ahamad
-
Could you post here your line code way of inding the controls ?
Parwej Ahamad
In the .cs page the rows are added as: TableRow tr = new TableRow(); TableCell tcPlace = new TableCell(); Label lblPlaces = new Label(); lblPlaces.Attributes.Add("runat", "server"); lblPlaces.ID = "lblPlaces" + i; lblPlaces.Text = arrstrPlaces[i]; tcPlace.Controls.Add(lblPlaces); tr.Cells.Add(tcPlace); TableCell tcRate = new TableCell(); TextBox txtRates = new TextBox(); txtRates.Attributes.Add("runat","server"); txtRates.ID = "txtRates" + i; txtRates.Width = 50; txtRates.Attributes.Add("onkeypress", "fnAccpNumDecimal(event)"); tcRate.Controls.Add(txtRates); tr.Cells.Add(tcRate); TableCell tcrfv_FD = new TableCell(); RequiredFieldValidator rfv_FD = new RequiredFieldValidator(); rfv_FD.Attributes.Add("runat", "server"); rfv_FD.ID = "rfv_FD" + i.ToString(); rfv_FD.ControlToValidate = txtRates.ID; rfv_FD.ErrorMessage = "Insert Rates"; rfv_FD.Display = ValidatorDisplay.Dynamic; rfv_FD.SetFocusOnError = true; rfv_FD.Text = "*"; rfv_FD.EnableClientScript = true; rfv_FD.ValidationGroup = "check"; rfv_FD.Visible = true; rfv_FD.Enabled = true; rfv_FD.EnableViewState = true; tcrfv_FD.Controls.Add(rfv_FD); tr.Cells.Add(tcrfv_FD); tblRateDetails.Rows.Add(tr);
modified on Monday, April 13, 2009 5:40 AM