.NETGURU
doubt abt asp .net HtmlInputFile ctrl
Messages   Related Types
This message was discovered on ASPFriends.com 'aspngbeta' list.
Responses highlighted in red are from those people who are likely to be able to contribute good, authoratitive information to this discussion. They include Microsoft employees, MVP's and others who IMHO contribute well to these kinds of discussions.

Sampada Khare
-- This message, which was originally sent to "aspngcommunity", has been moved to "aspngbeta" mailing list by the List Master --

Scenario: I have HtmlInputFile ctrls File_1 to File_5
In the Button_Click method with Script language as VB and runat =server i
have to upload the files.
How do i loop thru the HtmlInputFile ctrls w/o having to write seperate
code for all the ctrls???

Is there any method like there was "eval" in javascript ??

Reply to this message...
 
    
Scott Watermasysk (VIP)
For i = 1 to 5
Request.Form("File_" & i)
...
Next

HTH.
Scott

-----Original Message-----
From: Sampada Khare [mailto:Click here to reveal e-mail address]
Sent: Monday, May 07, 2001 7:04 AM
To: aspngbeta
Subject: [aspngbeta] doubt abt asp .net HtmlInputFile ctrl

-- This message, which was originally sent to "aspngcommunity", has been
moved to "aspngbeta" mailing list by the List Master --

Scenario: I have HtmlInputFile ctrls File_1 to File_5
In the Button_Click method with Script language as VB and runat =server i
have to upload the files.
How do i loop thru the HtmlInputFile ctrls w/o having to write seperate
code for all the ctrls???

Is there any method like there was "eval" in javascript ??

| [aspngbeta] member Click here to reveal e-mail address = YOUR ID
| http://www.asplists.com/asplists/aspngbeta.asp = JOIN/QUIT

Reply to this message...
 
    
Andy Smith (VIP)
The performance wouldnt' be the best... but...
All Controls have a FindControl method which takes a string as the id of =
the control.
So what you could do is a loop that generates a string of the control's =
id, and run a FindControl on the parent of them.

Andy Smith
Staff Programmer
Harding ESE

    -----Original Message-----
        From:    Click here to reveal e-mail address=20
Sent:    Monday, May 07, 2001 5:04 AM
To:    "aspngbeta" <Click here to reveal e-mail address>
Subject:    [aspngbeta] doubt abt asp .net HtmlInputFile ctrl
=09
-- This message, which was originally sent to "aspngcommunity", has been =
moved to "aspngbeta" mailing list by the List Master --

Scenario: I have HtmlInputFile ctrls File_1 to File_5
In the Button_Click method with Script language as VB and runat =3Dserver =
i
have to upload the files.
How do i loop thru the HtmlInputFile ctrls w/o having to write seperate
code for all the ctrls???

Is there any method like there was "eval" in javascript ??
=20

| [aspngbeta] member Click here to reveal e-mail address =3D YOUR ID
| http://www.asplists.com/asplists/aspngbeta.asp =3D JOIN/QUIT

Reply to this message...
 
    
Donny Mack
Short example:

Disclaimer I may be wrong with syntax because I couldn't test but you should
get the idea.

HttpFileCollection UploadedFiles = Request.Files;

for (int i = 0; i < UploadedFiles.Count; i++) {
UploadedFiles[i].SaveAs(Server.MapPath("Images") +
System.IO.Path.GetFileName(UploadedFiles[i].FileName)
}

Hope this helps

Don R. Mack, MCSD
CodeJunkies.NET
________________________________________________
Are you a DotNetJunkie?
http://www.AspNextGen.com | http://www.DotNetJunkies.com

Still not enough – Buy the book:
Programming Datadriven Web Applications with ASP.NET
by Don Mack, Doug Seven
http://www.amazon.com/exec/obidos/ASIN/0672321068/dotnetjunkies-20/107-16847" target="_blank">http://www.amazon.com/exec/obidos/ASIN/0672321068/dotnetjunkies-20/107-16847
06-9934918
<http://www.amazon.com/exec/obidos/ASIN/0672321068/dotnetjunkies-20/107-1684
706-9934918>
“You the man!”
- Me looking in the mirror!

-----Original Message-----
From: Sampada Khare [mailto:Click here to reveal e-mail address]
Sent: Monday, May 07, 2001 4:04 AM
To: aspngbeta
Subject: [aspngbeta] doubt abt asp .net HtmlInputFile ctrl

-- This message, which was originally sent to "aspngcommunity", has been
moved to "aspngbeta" mailing list by the List Master --

Scenario: I have HtmlInputFile ctrls File_1 to File_5
In the Button_Click method with Script language as VB and runat =server i
have to upload the files.
How do i loop thru the HtmlInputFile ctrls w/o having to write seperate
code for all the ctrls???

Is there any method like there was "eval" in javascript ??

| [aspngbeta] member Click here to reveal e-mail address = YOUR ID
| http://www.asplists.com/asplists/aspngbeta.asp = JOIN/QUIT

Reply to this message...
 
 
System.IO.Path
System.Web.HttpFileCollection
System.Web.UI.HtmlControls.HtmlInputFile




ExamGuru IT Solutions - .Net Guru is owned and operated by ExamGuru, Inc., the man behind .Net Guru. If you're in the market for bespoke software or software consultancy, why not get him and his highly trained team to help? - www.examguru.net/ITCertification
Ad


Need Dot Net Interview Questions?
Ask ExamGuru, Inc. for advice and help on Passing .Net Interviews
.Net Projects
Best-of-breed application framework for .NET projects, developed by ExamGuru, Inc. and ExamGuru IT
Free .net Help
Commission ExamGuru, Inc. and his team for your next bespoke software project
FogBUGZ
The only bug tracking system carefully crafted with one goal in mind: helping teams create great software.
Awesome Tools
If you don't know about these, you're missing out... IT Certification Questions
IT Interview Questions
Free Oracle 10g Training
MCSE Boortcamp
Cisco Study Guides
Cheap Study Guides
Exact Questions
Dot Net Interview Questions
Oracle OCP
Cheap Travel
Designer Perfumes - Wholesale Prices
Free Programming Tutorials
 
ExamGuru IT Solutions - .Net Guru is owned and operated by ExamGuru, Inc., the man behind .Net Guru. If you're in the market for bespoke software or software consultancy, why not get him and his highly trained team to help? - www.examguru.net/ITCertification
 Copyright © ExamGuru, Inc. 2001-2006
Contact Us - Terms of Use - Privacy Policy - www.dot-net-guru.com - www.examguru.net - www.oraclesource.net - www.itinterviews.net - www.examguru.net/ITCertification