Re: web.config servercontrol binding problem
- From: intrader <intrader@xxxxxxx>
- Date: Wed, 14 Mar 2007 13:39:51 -0700
Patrick F wrote:
solvedWould you mind sharing how you solved the problem. It would help me and perhaps others.
"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
Thanks
.
- Prev by Date: Data binding to a CompositeControl
- Next by Date: Re: Can you set a "required attribute" on control property?
- Previous by thread: Data binding to a CompositeControl
- Next by thread: Re: Can you set a "required attribute" on control property?
- Index(es):
Relevant Pages
|