Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / ASP.NET / General / April 2008

Tip: Looking for answers? Try searching our database.

.net 1.1, using multiple textboxes and dropdown boxes

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
mavrick101 - 14 Apr 2008 19:25 GMT
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???
mavrick101 - 14 Apr 2008 22:22 GMT
anyone???

> Hi,
>
[quoted text clipped - 32 lines]
>
> Any one???
bruce barker - 15 Apr 2008 02:01 GMT
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)

> anyone???
>
[quoted text clipped - 34 lines]
>>
>> Any one???

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.