Strange behavior with images, .resource files - System.Resources.MissingManifestResourceException

Discussion in 'ASP .Net' started by Gene, Nov 16, 2005.

  1. Gene

    Gene Guest

    I have a Windows Form control that I have embedded in an ASP.NET page.
    I now have the need to catch an event from the control on the webpage.

    After researching the situation I found that this is the way to expose
    events. I added the following code to my class.

    Imports System.IO
    Imports Assetta.ColumnStyles
    Imports ICSharpCode.SharpZipLib.Zip.Compression
    Imports ICSharpCode.SharpZipLib.Zip.Compression.Streams
    Imports System.Runtime.InteropServices
    Public Delegate Sub EventHandler(ByVal intVersionId As Integer)

    '--BEGIN--
    <GuidAttribute("B2157CA4-9127-4EE0-A4C1-DDD424CEE484"), _
    InterfaceTypeAttribute(ComInterfaceType.InterfaceIsIDispatch)> _
    Public Interface ControlEvents
    ' Add DisIdAttribute to any members in the source interface to
    specify the COM DISPID.
    <DispIdAttribute(1)> _
    Sub SaveComplete(ByVal intId As Integer)
    End Interface

    <ComSourceInterfaces(GetType(ControlEvents)), _
    ClassInterface(ClassInterfaceType.None)> _
    Public Class SaveClass
    '--END--

    This code works in a sample project that I got from the Microsoft site.
    When I incorporate it to my project the following line causes an error.
    This is in InitializeComponent()

    Me.imgPageDown.Image = CType(resources.GetObject("imgPageDown.Image"),
    System.Drawing.Image)

    The exception is:
    System.Resources.MissingManifestResourceException

    After researching this error I think something is wrong with the
    ..resource files. If I remove the lines my component works.

    Is there an easier way to catch an event on the web or does anyone have
    a solution that will let me run my code?

    Thanks!

    Gene
     
    Gene, Nov 16, 2005
    #1
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.