473,386 Members | 1,758 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

Table Control - how to recognize Text box

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

{
}

}

Jan 30 '06 #1
1 2305
Found answer by myself , thought it will be useful for the community

public void ImgSubmit_Click(){

TextBox i;

i = (TextBox)Page.FindControl("txtID");

if (!(i == null))

{

lblMessage.Text = i.Text;

}

else

{

lblMessage.Text = "not found";

}

}

"Krish" <vi***************@GMAIL.com> wrote in message
news:e2**************@TK2MSFTNGP10.phx.gbl...
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

{
}

}

Jan 30 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: NancyASAP | last post by:
In case anyone hasn't seen this problem, just sharing the info.... I created a dotnet 1.1 page with a literal control. I used a streamreader to open a text file to fill the control. I filled the...
1
by: Glenn P. | last post by:
Sorry, CDMA, I searched this NG on several combinations of words, but I didn't find a relevant hit, so here's my newbie question: I have an Access 2002 table which contains data extracted from...
6
by: cyoung311 | last post by:
I'm trying to do an automatic update of one table from another through a form. Basically, when a selection is made for an item, in this case a particular workshop, I want to get the associated...
11
by: Brian W | last post by:
Yet another editor problem To reproduce do the following 1) Open a Webform and switch to HTML edit mode 2) Enter the Following (include spaces) This is some text before <asp:hyperlink...
4
by: Andrea Williams | last post by:
I'm trying to set up a user control and change some values from the aspx page, but I keep running into trouble. What I really would like to do is be able to set a Label.Text in the user control...
0
by: mivhaelveloz | last post by:
Hiya Im trying to get a user control working in mono/ASP.NET. ....I have no problem getting a basic control up and working and using it declaratively in a hosting page's .aspx file. But for...
117
by: phil-news-nospam | last post by:
Is there really any advantage to using DIV elements with float style properies, vs. the old method of TABLE and TR and TD? I'm finding that by using DIV, it still involves the same number of...
9
by: keliie | last post by:
Hello (from Access novice), I'm building a switchboard form (using a Treeview object). The treeview is populated by two tables (tblSwitchboardParent and tblSwitchboardChild). Within...
0
by: Markus | last post by:
Hello I encountered a very annoying behaviour of IE7 with max-width on elements inside a table cell - it seems to be related to the max-width bugs on list items and floated elements (discussed...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.