K
Krish
Hi,
I am using table control to create table/cell & 2 text box & one image
button during runtime. Onclick event of image button i would like to
validate if there is any value in either of text boxes, but my intellisense
will not recognize those textboxes created during runtime. How to overcome
this issue. Pl. help.
protected void Page_Load(object sender, EventArgs e)
{
TableCell cellDateRange = new TableCell();
cellDateRange.Text = "Date Range:From - To : ";
TableCell txtDtFromCell = new TableCell();
TextBox txtDtFrom = new TextBox();
TableCell txtDtToCell = new TableCell();
TextBox txtDtTo = new TextBox();
TableCell imgCell = new TableCell();
ImageButton imgSubmit = new ImageButton();
imgSubmit.ImageUrl = "..\\images\\view.gif";
imgSubmit.Click += new ImageClickEventHandler(ImgSubmit_Click);
row.Cells.Add(cellDateRange);
txtDtFromCell.Controls.Add(txtDtFrom);
row.Cells.Add(txtDtFromCell);
txtDtToCell.Controls.Add(txtDtTo);
row.Cells.Add(txtDtToCell);
imgCell.Controls.Add(imgSubmit);
row.Cells.Add(imgCell);
filTable.Rows.Add(row);
}
public void ImgSubmit_Click(object sender, ImageClickEventArgs e)
{
lblMessage.Text = "";
if txtDtFrom.Text == "") ======> i get error here intellisense cannont
understand txtDtFrom
{
}
}
I am using table control to create table/cell & 2 text box & one image
button during runtime. Onclick event of image button i would like to
validate if there is any value in either of text boxes, but my intellisense
will not recognize those textboxes created during runtime. How to overcome
this issue. Pl. help.
protected void Page_Load(object sender, EventArgs e)
{
TableCell cellDateRange = new TableCell();
cellDateRange.Text = "Date Range:From - To : ";
TableCell txtDtFromCell = new TableCell();
TextBox txtDtFrom = new TextBox();
TableCell txtDtToCell = new TableCell();
TextBox txtDtTo = new TextBox();
TableCell imgCell = new TableCell();
ImageButton imgSubmit = new ImageButton();
imgSubmit.ImageUrl = "..\\images\\view.gif";
imgSubmit.Click += new ImageClickEventHandler(ImgSubmit_Click);
row.Cells.Add(cellDateRange);
txtDtFromCell.Controls.Add(txtDtFrom);
row.Cells.Add(txtDtFromCell);
txtDtToCell.Controls.Add(txtDtTo);
row.Cells.Add(txtDtToCell);
imgCell.Controls.Add(imgSubmit);
row.Cells.Add(imgCell);
filTable.Rows.Add(row);
}
public void ImgSubmit_Click(object sender, ImageClickEventArgs e)
{
lblMessage.Text = "";
if txtDtFrom.Text == "") ======> i get error here intellisense cannont
understand txtDtFrom
{
}
}