RE: web.config servercontrol binding problem

Tech-Archive recommends: Fix windows errors by optimizing your registry



solved

"Patrick F" wrote:

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
.



Relevant Pages

  • Re: web.config servercontrol binding problem
    ... private string imageName = string.Empty; ... public string ImageName ... public string ThemeName ...
    (microsoft.public.dotnet.framework.aspnet.buildingcontrols)
  • web.config servercontrol binding problem
    ... private string imageName = string.Empty; ... public string ImageName ... public string ThemeName ...
    (microsoft.public.dotnet.framework.aspnet.buildingcontrols)
  • making server component themeable?
    ... Hi, i created a server control, but how can i add my server control to the ... private string imageName = string.Empty; ... public string ImageName ... public string ThemeName ...
    (microsoft.public.dotnet.framework.aspnet.buildingcontrols)
  • Re: XML generation from a Schema
    ... public partial class RefillRequest { ... private string prescriberOrderNumberField; ... public string PrescriberOrderNumber { ... private MandatoryNameType pharmacistAgentField; ...
    (microsoft.public.dotnet.xml)
  • Re: XML Generation and consumption
    ... I'm not even sure I'm starting in the right place with HeaderType - ... private string versionField; ... public string version { ... private UsernameTokenType usernameTokenField; ...
    (microsoft.public.dotnet.xml)