Code behind required file

Thread is closed for posting
4 posts, 0 answers
  1. Herve
    Herve avatar
    39 posts
    Member since:
    Jun 2008

    Posted 12 Apr 2010 Link to this post

    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

     

     

     

     

  2. Veselin Vasilev
    Admin
    Veselin Vasilev avatar
    2992 posts

    Posted 13 Apr 2010 Link to this post

    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.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Herve
    Herve avatar
    39 posts
    Member since:
    Jun 2008

    Posted 13 Apr 2010 Link to this post

    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

  5. Veselin Vasilev
    Admin
    Veselin Vasilev avatar
    2992 posts

    Posted 14 Apr 2010 Link to this post

    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.
Back to Top