473,395 Members | 1,905 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,395 software developers and data experts.

.net 1.1, using multiple textboxes and dropdown boxes

Hi,

I have a webform which has 4 panels.

Each panel would have about 20 textboxes and dropdown boxes. I have named
the controls like
Panel1:
_textboxP1T1;
_textboxP1T2;
......
similarly
_listP1L1;

so goes for other Panels, 2, 3 and 4.

On page submit, I get the values in those textboxes like this....

for (int i=1;i<=20;i++)
{

Textbox tempBox = (TextBox) Page.FindControl("_textboxP1T" +
i.ToString());
if (tempBox != null)
{
.........
}
}

My question is, is it the only way? Is there a way similar to 'eval' in
Javascript?

so I can just grab the value of the text box like

eval("_textboxP1T" + i.ToString).Text....

Any one???


Jun 27 '08 #1
2 941
anyone???

"mavrick101" wrote:
Hi,

I have a webform which has 4 panels.

Each panel would have about 20 textboxes and dropdown boxes. I have named
the controls like
Panel1:
_textboxP1T1;
_textboxP1T2;
.....
similarly
_listP1L1;

so goes for other Panels, 2, 3 and 4.

On page submit, I get the values in those textboxes like this....

for (int i=1;i<=20;i++)
{

Textbox tempBox = (TextBox) Page.FindControl("_textboxP1T" +
i.ToString());
if (tempBox != null)
{
.........
}
}

My question is, is it the only way? Is there a way similar to 'eval' in
Javascript?

so I can just grab the value of the text box like

eval("_textboxP1T" + i.ToString).Text....

Any one???

Jun 27 '08 #2
no. c# does not have the equivalent (only the new dynamic .net
languages, python, ruby and javascript have it). you could use the
codedom to generate the code at runtime but it would not be as clean as
your code. you could write a function to encapsulate the find and cast.
-- bruce (sqlwork.com)

mavrick101 wrote:
anyone???

"mavrick101" wrote:
>Hi,

I have a webform which has 4 panels.

Each panel would have about 20 textboxes and dropdown boxes. I have named
the controls like
Panel1:
_textboxP1T1;
_textboxP1T2;
.....
similarly
_listP1L1;

so goes for other Panels, 2, 3 and 4.

On page submit, I get the values in those textboxes like this....

for (int i=1;i<=20;i++)
{

Textbox tempBox = (TextBox) Page.FindControl("_textboxP1T" +
i.ToString());
if (tempBox != null)
{
.........
}
}

My question is, is it the only way? Is there a way similar to 'eval' in
Javascript?

so I can just grab the value of the text box like

eval("_textboxP1T" + i.ToString).Text....

Any one???

Jun 27 '08 #3

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

Similar topics

1
by: Jim Heavey | last post by:
Hello, I am having a strange problem with my ASP.Net web page. When I am in Visual Studio and I place a textbox and a Dropdown box on the form, when I run the application and view it in the...
2
by: Shankar Mani via DotNetMonster.com | last post by:
Hi folks, I am facing a problem while using a DataGrid. I have a webform with a datagrid containing two text boxes for edit viz., countrycode and country name. Like wise I have two more text boxes...
2
by: alpoor | last post by:
I have lots of textboxes on my webform. I need to bind them with fields from table. I am not sure how to bind with textboxes. I have seen so many samples for dropdown boxes and datagrid binding,...
2
by: Jason James | last post by:
Hi, I have a datalist that contains a series of thumbnails. I am in the process of paging this datalist so that only 20 images are displayed at a time. Each image has associated with it a...
3
by: sewerized | last post by:
Hello all, I'm having a problem with a user preferences form I'm creating. I want to use dynamic dropdown SELECT boxes for this so my page doesn't get cluttered with 100000 links. Since I...
10
by: Paul | last post by:
Hi I am using the HtmlInputFile control to upload a file from a client to a server. I have a browse to find the file on the server but need to create the path dynamically as to were it will go...
5
by: abhishek92 | last post by:
I have made a page. I need a provision that when a person selects the number of items from dropdown box ... that number of textboxes should be displayed so that he can enter description about all...
2
by: englishman69 | last post by:
Hello, I have been banging my head against this one for a while... Searches online have revealed many different proposals for correcting my issue but none that I can follow! My basic situation...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
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...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.