locked
HTML5 controls not in enabled in vs11? RRS feed

  • Question

  • User-1121540557 posted

    Hi,

    I've a standard asp upload control in standard asp webform in visual studio 2012

    Now I've stript the

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

    to

    <!DOCTYPE html>

    The problem is that i still don`t have the property AllowMultiple="true" in the upload control...I don`t want to use the input control..

    Does someone knows what i need to do to get the html5 controls enabled?

    Best regards,

    Mark

    Thursday, April 24, 2014 6:27 AM

Answers

  • User753101303 posted

    I'll have to test but retargeting the framework should do the switch unless perhaps you manually added references to some old .NET 4.0 framework assemblies copied somewhere ?

    The problem for now is that it seems whatever you do, you stick to the .NET 4.0 version. If you look at :

    http://msdn.microsoft.com/en-us/library/system.web.ui.webcontrols.fileupload(v=vs.110).aspx and switch back and forth between 4.0 and 4.5 you'll see that those features are new for this control starting with 4.5. So you have really to switch to 4.5. If  once the switch is done you don't have access then it seems you have some kind of strange issue. Once switched what if you use the object browser. Do you see this on the FileUpload class ?

    What if you try to directly create a new .NET 4.5 project. Do you have the same issue than in your existing project ?

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Thursday, April 24, 2014 9:44 AM

All replies

  • User753101303 posted

    Hi,

    It doesn't depend on VS. It depends on which .NET Framework version you are targeting. See the project properties and double check that it targets .NET 4.5 rather than .NET 4.0...

    Thursday, April 24, 2014 6:49 AM
  • User-1121540557 posted

    Hi ParticeSc,

    My target framework is 4.0, bud it doesn`t matter if i refer to 4.0 or 4.5 the problem stays the same..I can`t acces the property AllowMultiple in the standard asp file upload..

    Ok I can select multiple files, bud in the C# code I cant read multiple files(FileUpload1.HasFiles) I can only say FileUpload1.HasFile...

    If I look wich system.web dll is loaded it is version v4.0.30319 so it should do it..

    Hope you can still help me..

    Best regards,

    Mark

    Thursday, April 24, 2014 8:58 AM
  • User753101303 posted

    I'll have to test but retargeting the framework should do the switch unless perhaps you manually added references to some old .NET 4.0 framework assemblies copied somewhere ?

    The problem for now is that it seems whatever you do, you stick to the .NET 4.0 version. If you look at :

    http://msdn.microsoft.com/en-us/library/system.web.ui.webcontrols.fileupload(v=vs.110).aspx and switch back and forth between 4.0 and 4.5 you'll see that those features are new for this control starting with 4.5. So you have really to switch to 4.5. If  once the switch is done you don't have access then it seems you have some kind of strange issue. Once switched what if you use the object browser. Do you see this on the FileUpload class ?

    What if you try to directly create a new .NET 4.5 project. Do you have the same issue than in your existing project ?

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Thursday, April 24, 2014 9:44 AM
  • User-1454326058 posted

    Hi Clubict,

    On the other hand, please check the Platforms support:

    # FileUpload.AllowMultiple Property

    http://msdn.microsoft.com/en-us/library/system.web.ui.webcontrols.fileupload.allowmultiple(v=vs.110).aspx

    Please try it with the new project.

    Thanks

    Best Regards

    Friday, April 25, 2014 3:35 AM
  • User-1121540557 posted

    Hi PatriceSc,

    You are right and not...The problem was that if I started a new web application/site vs automaticly refered to .net 4.0..now I've made a new web site with the reference to 4.5..and al goes fine..

    I never added 4.0 dll`s manualy...They've been installed at the installation from vs11 Pro..Microsoft has made some updates and new releases...but never I've tweaked/copied the dll`s manualy..

    So for some reason my 4.0 dll's are not the real deal?

    Do you know where I can get the real ones?

    Best regards,

    Mark

    Friday, April 25, 2014 7:21 AM
  • User753101303 posted

    And so even if you target 4.5 it still doesn't work ? Trying to be clear :

    - it will NEVER work with .NET 4.0 (or at least you are on your own to generate the markup you want, server side controls such as UploadFile won't do this out of the box)
    - this is new in .NET 4.5  and as such it requires .NET 4.5 to work

    So:
    - either you need to stick to 4.0 and you are on your own to generate the proper markup
    - or else you have to change your project so that it runs using .NET 4.5 and use the new version of those controls (note that 4.5 won't run on Windows Server 2003). You may perhaps have to rebuild the app or perhpas do you have something left in the web.config or whatever (this is a web site project rather than a web application project ?)

    Friday, April 25, 2014 8:22 AM
  • User-1121540557 posted

    No it works fine on 4.5...I tought it also should work on 4.0..My mistake..Thanks for your help!

    Friday, April 25, 2014 8:26 AM