web.config servercontrol binding problem

Discussion in 'ASP .Net Building Controls' started by Patrick F, Feb 25, 2007.

  1. Patrick F

    Patrick F Guest

    Hi,
    I created a very simple server control, but i cant bind it in web.config, i
    keep getting this error message:
    Parser Error Message: Could not load file or assembly 'LaberImage,
    Version=1.0.0.0, Culture=neutral, PublicKeyToken=d757f12d29dc4c83' or one of
    its dependencies. The located assembly's manifest definition does not match
    the assembly reference. (Exception from HRESULT: 0x80131040)

    Here is the web.config:
    <add tagPrefix="asp" namespace="LaberImage" assembly="LaberImage,
    Version=1.0.0.0, Culture=neutral, PublicKeyToken=d757f12d29dc4c83"/>

    And here is the simple control:
    using System;
    using System.Web.UI.WebControls;
    using System.Web.UI;

    namespace LaberImage
    {
    public class LaberImage : System.Web.UI.WebControls.Image
    {
    public LaberImage()
    {
    }

    private string imageName = string.Empty;
    public string ImageName
    {
    get
    {
    return imageName;
    }
    set
    {
    imageName = value;
    }
    }
    private string themeName = string.Empty;
    public string ThemeName
    {
    get
    {
    return themeName;
    }
    set
    {
    themeName = value;
    }
    }
    protected override void OnPreRender(EventArgs e)
    {
    if ((System.Web.HttpContext.Current.Session["theme"] == null) ||
    (System.Web.HttpContext.Current.Session["theme"].ToString() == ""))
    ImageUrl = "/App_Themes/" + themeName + "/" + imageName;
    else
    ImageUrl = "/App_Themes/" +
    System.Web.HttpContext.Current.Session["theme"] + "/" + imageName;

    base.OnPreRender(e);
    }
    }
    }

    I want to register it in web.config so i can use:
    <asp:LaberImage ......
    and so i can apply a theme to it

    Any ideas?

    Patrick
     
    Patrick F, Feb 25, 2007
    #1
    1. Advertisements

  2. Patrick F

    Patrick F Guest

    solved
     
    Patrick F, Feb 25, 2007
    #2
    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.