473,396 Members | 2,147 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,396 software developers and data experts.

Howto to use resources from System.Web?

I am using the ContentTemplate to extend the CreateUserWizard's
CreateUserWizardStep with additional controls. For the CreateUserWizardStep
labels, I would like to keep the automatic localization.
With Lutz Roeder's .Net Reflector, I found out that System.Web contains the
text resource System.Web.Resources and I found e.g. the name/value-pair
CreateUserWizard_DefaultUserNameLabelText=User Name:

My question here is: how can I bind this resource entry to the label?

I tried adding
Text="<%$ Resources:System.Web.resources,
CreateUserWizard_DefaultUserNameLabelText %>
to the asp:Label but I get the error message:
Parser error. The resource object with key
'CreateUserWizard_DefaultUserNameLabelText' was not found.
<asp:Label ID="UserNameLabel" runat="server" AssociatedControlID="UserName"
Text="<%$ Resources:System.Web.resources,
CreateUserWizard_DefaultUserNameLabelText %>" /></td>
Any help would be greatly appreciated.
Dieter
Nov 2 '06 #1
2 1593
Hello Dieter,

From your description, you're using the ContentTemplate to customize the
CreateUserWizard control and also want to utilize the existing localizaed
resources of the CreateuserWizard control. However, when you try using the
<%$ Resources:... %expression to reference the resource, it not work,
correct?

As for this issue, it is due to the natural limitation of the <%$ Resource
%expression, this expression just identical to the following methods in
page:

HttpContext.GetGlobalResourceObject Method

HttpContext.GetLocalResourceObject Method

Both of the two methods(also the <%$ Resource expression %>) can only
reference resource items defined within the current ASP.NET application's
LocalResource or GlobalResource, but can not reference resource items in
external assemblies. Actually, through the reflector diassembled code, you
can find that the built-in CreateUserWizard control is using the following
code to load resource string from assembly:

==================
ResourceManager rm = new ResourceManager("System.Web",
typeof(CreateUserWizard));

rm.GetString(keyname, Culture);

===================

Therefore, if you want to load any localization resource objects from
external assembly, you need to use ResourceManager to do it
programmatically.
Please feel free to let me know if you have anything unclear or any other
questions here.

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead

==================================================

Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscripti...ult.aspx#notif
ications.

Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscripti...t/default.aspx.

==================================================

This posting is provided "AS IS" with no warranties, and confers no rights.

Nov 3 '06 #2
Hello Steven,

thanks for the feedback!
ResourceManager rm = new ResourceManager("System.Web",
typeof(CreateUserWizard));
using typeof(CreateUserWizard).Assembly (with ".Assembly") instead, will
make it comilable.

The solution you have provided works great. Thanks a lot!

Best regards,
Dieter
Nov 5 '06 #3

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

Similar topics

4
by: Logan | last post by:
Several people asked me for the following HOWTO, so I decided to post it here (though it is still very 'alpha' and might contain many (?) mistakes; didn't test what I wrote, but wrote it - more or...
11
by: Matt | last post by:
I have object/machine code in static library (written and compiled using C++) that I wish to make difficult to reverse-engineer. I am told by others that some could reverse-engineer this...
0
by: ATS | last post by:
HOWTO Extract resources from .NEt User Control and save them to file. Please help, I have a .NET C# User Control (derrived from System.Windows.Forms.UserControl), and I want to embed into it...
0
by: Kruq | last post by:
Hello, I have a problem. In development environment we have few dev workstations and one development database. Application allows to upload some resources to HDD and store its descriptors into...
4
by: Ray Dukes | last post by:
What I am looking to do is map the implementation of interface properties and functions to an inherited method of the base class. Please see below. ...
0
by: Brian Henry | last post by:
Here is another virtual mode example for the .NET 2.0 framework while working with the list view. Since you can not access the items collection of the list view you need to do sorting another...
8
by: Topper | last post by:
Hello. I have simple web folders structure: -ROOT - BIN WebService.dll WebService.asmx I need to use my WebService.dll not in bin folder - for example, in ROOT. How do i this? How can i do...
0
by: Rob Dob | last post by:
Hi, I have a VS2003 C# asp.net project that has been converted into a VS2005 project. Everything seemed to work well until I make a modification to anything within the Component Designer...
0
by: shamirza | last post by:
· When was .NET announced? Bill Gates delivered a keynote at Forum 2000, held June 22, 2000, outlining the .NET 'vision'. The July 2000 PDC had a number of sessions on .NET technology, and...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

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.