web.config servercontrol binding problem

P

Patrick F

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
 

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. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top