Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / ASP.NET / Building Controls / March 2007

Tip: Looking for answers? Try searching our database.

web.config servercontrol binding problem

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Patrick F - 25 Feb 2007 10:09 GMT
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 - 25 Feb 2007 10:50 GMT
solved

> Hi,
> I created a very simple server control, but i cant bind it in web.config, i
[quoted text clipped - 66 lines]
>
> Patrick
intrader - 14 Mar 2007 21:39 GMT
> solved
>
[quoted text clipped - 68 lines]
>>
>> Patrick
Would you mind sharing how you solved the problem. It would help me and
perhaps others.

Thanks

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.