This is a migrated thread and some comments may be shown as answers.

Code behind required file

3 Answers 86 Views
Upload (Obsolete)
This is a migrated thread and some comments may be shown as answers.
Herve
Top achievements
Rank 2
Herve asked on 13 Apr 2010, 02:14 AM
Hi,

I'm using the following code behing at the send form button click event in order to check if my RadUpload has at last 1 file to be uploaded, this works fine in IE but not in Firefox that display the error message each times.

Dim CheckNbrPics As Integer = 0

 

For Each file As UploadedFile In RuPhotos.UploadedFiles

 

CheckNbrPics = CheckNbrPics + 1

 

Next file

 

 

If CheckNbrPics = 0 Then

 

MyFormValid =

False

 

sbError.Append(

"<li class=""Error"">Error text</li>")

 

 

End If

The files are saved in a second time.

I would like to keep this validation in the logik of my code behing, is it possible ?

It seems that FF download 1st the files and play the code after this, IE not.

Any idea to fix it ?

Thanks,


Herve

 

 

 

 

3 Answers, 1 is accepted

Sort by
0
Veselin Vasilev
Telerik team
answered on 13 Apr 2010, 03:16 PM
Hello Herve,

The code looks ok to me.
Does this code fires twice? What exactly happens when you debug?

Ideally, you can send us a sample page where we can reproduce the problem.

Kind regards,
Veskoni
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
0
Herve
Top achievements
Rank 2
answered on 13 Apr 2010, 03:31 PM
Hi Veskoni,

I can't see exactly what happend in the debug mode as the problem is only related to Firefox, IE checks the validity with these few ligns of code and downloads normally if there is at last 1 file. I can only see the RadUploadManager loading the file(s) before getting the error message displayedin Firefox.

The exact code fires only one time when my submit button is clicked (checked in debug mode with IE).

Thanks for your support,


Herve


Dim CheckNbrPics As Integer = 0

For Each file As UploadedFile In RuPhotos.UploadedFiles

CheckNbrPics = CheckNbrPics + 1

Next file 

If CheckNbrPics = 0 Then

MyFormValid = False

sbError.Append("<li class=""Error"">Error text</li>")

Else 

Register into DB & Save files code

End If

0
Veselin Vasilev
Telerik team
answered on 14 Apr 2010, 08:59 AM
Hi Herve,

You can set Firefox as your default browser in Visual Studio just for the test. To do so - right click on the page and select Browse With. In the opened dialog select Firefox and click on the Set as default button.
Later you can revert the change following the same steps.

There is something that I do not understand:

"IE checks the validity with these few ligns of code and downloads normally"
"I can only see the RadUploadManager loading the file(s)"

what exactly is downloaded, what is RadUploadManager and how do you see it loading the files?

Thanks

Greetings,
Veskoni
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
Tags
Upload (Obsolete)
Asked by
Herve
Top achievements
Rank 2
Answers by
Veselin Vasilev
Telerik team
Herve
Top achievements
Rank 2
Share this question
or