locked
Hosting UserControl in IE RRS feed

  • Question

  • User-1831556683 posted

    Hi,

    I've an ASP site that delivers html code. One of the delivered html pages host a UserControl inside an OBJECT tag

    The UserControl (UC) is supposed to display an image. However, the UC is drawn, but no image is displayed despite I'm invokating a method that perfom that action. And when I right-click over the UC to display a menu, it throws a security exception:

    Application attempted to perform an operation not allowed by the security police...

    Request for the permission of type ' System.Security.Permissions.UIPermission, mscorlib Version 2.0.0.0., Culture=neutral, PublicKeyToken=b77a5c561934e089' failed.

    The HTML code tag embedding the UC looks like:

    <OBJECT ID=UC1 WIDTH=800 HEIGHT=400 classid="http:UC.dll#Viewer.UCView"></OBJECT>

    If I try this code in a single asp page in a new website it works fine. But, when it's integrated into an existent ASP website it throws the exception.

    Am I missing something in web.config file?

    Wednesday, October 8, 2014 5:03 PM

All replies

  • User-734925760 posted

    Application attempted to perform an operation not allowed by the security police...

    Request for the permission of type ' System.Security.Permissions.UIPermission, mscorlib Version 2.0.0.0., Culture=neutral, PublicKeyToken=b77a5c561934e089' failed.

    Hi,

    According to the error message, it wants to tell us that we need to have the aspnet user have permission to write to the location on your hard disk you want. So please refer to go into Properties / Security settings on file folder and make it writeable.

    Hope it's useful for you.

    Best Regards,

    Michelle Ge

    Thursday, October 9, 2014 4:56 AM
  • User-1831556683 posted

    Thanks for your answer.

    I'm looking for clarification.

    Have I to grant write permissions, despite the code is not writing to the folder contains the asp file?

    This permission should be set over the folder containing the asp file?

    Thursday, October 9, 2014 9:49 AM
  • User311508580 posted

    Hi oquesada,

    From the error message, it requires permission. Please kindly try to give the full permission and hope it will fix your issue.

    Good luck

    Sunday, October 12, 2014 10:46 PM
  • User-734925760 posted

    This permission should be set over the folder containing the asp file?

    Hi,

    Yes, I think you should give full permissions for the folder.

    Best Regards,

    Michelle Ge

    Tuesday, October 21, 2014 6:03 AM