Iterating through HTML Controls from codebehind

  • Thread starter Thread starter RSH
  • Start date Start date
R

RSH

Hi,

I have a situation where I have 10 HTMLFileInput controls on my aspx page.
They are all named UploadedFile1,UploadedFile2...

Now on postback I am trying to construct a loop to check for values in those
fields. I can't for the life of me figure out how to do this. i tried:

Dim j As Integer = 0

For j = 0 To 10

If Len(Trim(Request.QueryString("UploadedFile" & j))) > 0 Then

UploadFile(FindControl("UploadedFile" & j), CompanyID, ReturnId)

End If

Next

Everything comes back as nothing



Dim j As Integer = 0

For j = 0 To 10

If Len(Trim(Findcontrol("UploadedFile" & j))) > 0 Then

UploadFile(FindControl("UploadedFile" & j), CompanyID, ReturnId)

End If

Next

Everything comes back at nothing.



What is the correct way to get at the value of the controls (remember they
are HTML Controls).



Thanks,

Ron
 
Back
Top