473,782 Members | 2,487 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Howto to use resources from System.Web?

I am using the ContentTemplate to extend the CreateUserWizar d's
CreateUserWizar dStep with additional controls. For the CreateUserWizar dStep
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.Reso urces and I found e.g. the name/value-pair
CreateUserWizar d_DefaultUserNa meLabelText=Use r Name:

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

I tried adding
Text="<%$ Resources:Syste m.Web.resources ,
CreateUserWizar d_DefaultUserNa meLabelText %>
to the asp:Label but I get the error message:
Parser error. The resource object with key
'CreateUserWiza rd_DefaultUserN ameLabelText' was not found.
<asp:Label ID="UserNameLab el" runat="server" AssociatedContr olID="UserName"
Text="<%$ Resources:Syste m.Web.resources ,
CreateUserWizar d_DefaultUserNa meLabelText %>" /></td>
Any help would be greatly appreciated.
Dieter
Nov 2 '06 #1
2 1608
Hello Dieter,

From your description, you're using the ContentTemplate to customize the
CreateUserWizar d control and also want to utilize the existing localizaed
resources of the CreateuserWizar d 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.Get GlobalResourceO bject Method

HttpContext.Get LocalResourceOb ject 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 CreateUserWizar d control is using the following
code to load resource string from assembly:

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

rm.GetString(ke yname, Culture);

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

Therefore, if you want to load any localization resource objects from
external assembly, you need to use ResourceManager to do it
programmaticall y.
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(CreateUs erWizard));
using typeof(CreateUs erWizard).Assem bly (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
3849
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 less - during my own installation of Python 2.3 on Fedora Core 1 Linux for a friend of mine). Anyway, HTH, L.
11
4113
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 object/machine code to generate some or all of the source, and while it may not be a trivial task, it would not be impossible. Do tools, processes, or other means exist by which I could do this? I'm looking for something analogous to code obfuscation...
0
1119
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 large EXE files as resources, which the User Control will extract when run, and save to file, and then run. How can this be done?
0
1154
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 db, since we have one database and three workstations - hdd resources differ. We'd like to have evrything common. So one database and one resources repository. We'd like to map some network drive for each of workstations
4
2858
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. '**************************************************************************** ' Issues '****************************************************************************
0
3242
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 way... here is my code on how I did it to help anyone starting out get an idea of how to use virtual mode in ..NET 2.0 Imports CrystalDecisions.CrystalReports.Engine Imports CrystalDecisions.Shared
8
4195
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 this without .config file only with some configuration
0
9170
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 window, i.e. I add a SQLCommand. At that point VS2005 changes my C# file to now load all Selectcommantext data from the resource file instead of the .aspx.cs file. then when I try and once again run my application I get the following error: looking...
0
3669
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 delegates were given CDs containing a pre-release version of the .NET framework/SDK and Visual Studio.NET. · When was the first version of .NET released? The final version of the 1.0 SDK and runtime was made publicly available around 6pm PST on...
0
9639
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9479
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10146
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10080
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9942
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8967
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7492
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6733
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
3
2874
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.