473,320 Members | 1,977 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

Assembly with USER controls (ascx) cannot find its resources

Hi,

I built an assembly with a set of user controls.
This can be done with the Visual Studio 2005 Deployment Project:
building and merging for example all your aspx and ascx in one dll
(lets say BunchOfUserControls.dll)
Doing so it's possible to resuse user controls in other web projects
without transferring the ascx files. Just the dll.
The reason I need this is because I need to load dynamicly controls in
a website.
This works fine.
The only thing to keep in mind is that it's not possible to use your
own class name.
Supose your user control is named MyNameSpace.MyUserControl the final
dll will contain a class named ASP.<name sub folder>_MyUserControl_ascx
This class is derived from my own class and overrides the
FrameworkInitialize method in order to render the ascx declarative
code.
<name sub folder> is the folder were I've got my user controls in the
original solution.
So creating the user control dynamicly you need to do the following:

Assembly assembly = Assembly.Load("BunchOfUserControls");
object instance =
portletAssembly.CreateInstance("ASP.mysubfolder_my usercontrol_ascx");
myPage.Controls.Add((Control)instance);

This works fine. The page shows correcly the user control.

And now my problem: I need to localize my controls. Just created resx
files for some languages and used the same technique to create my
assemblies.
Web deployment project creates an assembly for the resources:
App_LocalResources.mysubfolder.cdcab7d2.dll
Running the system again it produces an error after adding my control
to the page: cannot find resouce file.
After inspecting the resource dll (with Reflector) I see all my user
controls, however the've got the original names (MyUserControl). The
user control dll (with Reflector) shows mysubfolder_myusercontrol_ascx.
So I guess there is a problem matching the two.

The main question is: how can a merge my user controls into one dll and
still use the local resource files with meta:resourcekey="blabla"
declarations in the original ascx controls?

Kind regards,

Michel

Mar 14 '06 #1
0 2131

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Carlos G Benevides | last post by:
I have a ASP.Net web application that has two assemblies that run under com+. Under Windows 2000 the two assemblies are added to com+ automatically when instantiated from the web site. For this...
11
by: Wolfgang Kaml | last post by:
I am not sure if this is more of an expert question, but I am sure that they are out there. I'd like to setup a general application or bin directory on my Win2003.Net Server that will hold some...
2
by: Peter Jackson | last post by:
I'm using v2 of the UIP App. Block. I've created all my .aspx pages, all of which contain .ascx user controls. The .ascx user controls provide the standard server controls (i.e., LinkButtons, etc.)...
0
by: Steve Richter | last post by:
I have moved a user control from my asp.net web application project into a separate assembly. Where I had registered the control this way: <%@ Register TagPrefix="ac" TagName="ArticleSummary"...
10
by: jojobar | last post by:
Hello, I am trying to use vs.net 2005 to migrate a project originally in vs.net 2003. I started with creation of a "web site", and then created folders for each component of the site. I read...
1
by: ddelaney | last post by:
I've seen this posted before in many places, but have yet to find a real fix. I have a web application on dev server right now, and randomly, hours or days, it returns the expception posted below. ...
4
by: tshad | last post by:
Is there a way for a User Control to access an object (such as label or textbox) on the .aspx page that calls it? For example: x.aspx ************************************** .... Sub...
8
by: mark.norgate | last post by:
I've run into a few problems trying to use generics for user controls (classes derived from UserControl). I'm using the Web Application model rather than the Web Site model. The first problem...
3
by: Jonathan Wood | last post by:
I could really use some help on this. First of all, I want to create a Web control where I render the control completely from scratch based on information from a database. In the book...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.