Small width layout Medium width layout Maximum width layout Small text Medium text Large text
     Search
Downloads Downloads Directory Directory Forums Forums Forge Forge Blogs Blogs        Marketplace Marketplace Careers Program Careers
Community › Forums Register  |  

$4.95 Windows Hosting at Webhost4life.com
  Need Help?  
Professional technical support for DotNetNuke is available from DotNetNuke Corporation.
 


  Ads  
Aspose - The .NET & Java component publisher
 


  Sponsors  

Meet Our Sponsors

SteadyRain
DataSprings - Great Ideas. Always Flowing.
R2integrated - formerly bi4ce
Jango Studios - Skins, Modules and Hosting for DotNetNuke
eUKhost.com is commited to offer exceptional UK Windows Web Hosting solutions with quality 24x7 technical support.Our plans support ASP.Net, ASP, ASP.NET Ajax extensions, XML, MSSQL, MySQL, PHP,DNN, multiple domains and Shared SSL as standard.
SmarterTools
 


DotNetNuke Forums
 
  Forum  General DotNetN...  Localize It! (L...  How to cuse a single resource file for multiple .ascx files
Previous Previous
 
Next Next
New Post 2/22/2008 5:22 AM
Unresolved
User is offline nadeem
5 posts
10th Ranked


How to cuse a single resource file for multiple .ascx files 

Hi,

I have a resource file that has resource names and their values which i need to use across the project. Project contains multiple .ascx files. I want to use the resource strings all over the project. Till now, i haven't found exact solution of that. I have used resourcekey keyword but i does not picks value from the resource file. I placed the file in App_GlobalResources, in 'Resources' folder, in App_LocalResources (project level), but none of them worked.

Any idea!

 

 
New Post 2/22/2008 7:10 AM
User is offline Sebastian Leupold
12957 posts
www.deutschnetnuke.de
1st Ranked












Re: How to cuse a single resource file for multiple .ascx files 

you can place resource keys, that are used by multiple controls of your module, in a shared resource file, called "SharedResources.resx


Sebastian Leupold



DotNetNuke Project UserDefinedTable
DotNetNuke Project XML/XSL
 
New Post 2/24/2008 9:32 PM
User is offline nadeem
5 posts
10th Ranked


Re: How to cuse a single resource file for multiple .ascx files 

I placed the resource keys in SharedResources.resx file (placed under Resources folder) but when i use a resource string using ResourceKey="anyresourcekey", no text is shown at the place where i used resource key. e.g,

<dnn:labelcontrol id="lblLanguages" runat="server" ResourceKey="lblLanguages.Text" >

'lblLanguages.Text' is resource key inside the resource file. I also tried to use following syntax but it doesn't worked (It works fine in standard asp.net application)

<asp:Literal ID="Literal1" runat="server" Text="<%=Resources: MyResourceFile, lblLanguages.Text%>" />

The only thing that works is when resource file is placed in association with control in App_LocalResources folder by following syntax (which is not needed in my scenario). for example

<asp:TextBox ID="txtRedirectURL" runat="server" CssClass="abc" meta:resourcekey="txtPhoneNumberResource1" MaxLength="255"></asp:TextBox>

It would be nice if you list down all the steps in detail including how to use the resource key. I may be missing some step. Please note that our application is Module based.

 
New Post 2/26/2008 10:31 PM
User is offline nadeem
5 posts
10th Ranked


Re: How to cuse a single resource file for multiple .ascx files 

Hi All,

That worked. Here is the detail.

In order to have a single resource file to be used in all project, string must be entered in SharedResources.resx (remeber to use the file already placed under App_GlobalResources folder. This folder can be found under the root project name).

In order to use the strings defined in that file, we can use the following syntax.

<asp:Label ID="lblFeatures" runat="server" resourcekey="lblFeatures.Text" />

resourcekey works on most of the asp controls and dnn label control but not all of them. It may show you an underline (error) but the 'Build' will succeed.

Currently i am searching how to have your own .resx file and using strings from it both in .ascx and .vb (or .cs) file.

Any idea!

 
New Post 2/28/2008 3:47 AM
User is offline nadeem
5 posts
10th Ranked


Re: How to cuse a single resource file for multiple .ascx files 

Hi All,

After some R&D, i have found how to use resources from single file in our .vb or .cs files. Here is the example

DotNetNuke.Services.Localization.Localization.GetString("mykey.Text", ResolveUrl("~\App_GlobalResources\ResourceFileName.resx"))

Resourcefilename.resx can be SharedResources.resx or any other file you need to use.

Now currently the problem left is to use our own resource file (in App_GlobalResources folder) in *.ascx file.

Any idea!

 

 

 
Previous Previous
 
Next Next
  Forum  General DotNetN...  Localize It! (L...  How to cuse a single resource file for multiple .ascx files
 


Forum Policy

These Discussion Forums are dedicated to the discussion of the DotNetNuke Web Application Framework.

For the benefit of the community and to protect the integrity of the project, please observe the following posting guidelines:

1. No Advertising. This includes promotion of commercial and non-commercial products or services which are not directly related to DotNetNuke.
2. Discussion or promotion of DotNetNuke product releases under a different brand name are strictly prohibited.
3. No Flaming or Trolling.
4. No Profanity, Racism, or Prejudice.
5. Site Moderators have the final word on approving/removing a thread or post or comment.
6. English language posting only, please.

 


Aricie
Aricie is one of the French pioneers and experts in DotNetNuke technology.
www.aricie.com
AFUEGO!
Looking for Free DNN Hosting?
www.AFUEGO.com
Code 5 Systems, LLC.
The DNN Missing Link: A Form Module. Form Master 1.6 is an intuitive Form Creation Module at a great price. Quality Custom Module development, and DNN consulting services.
www.code5systems.com

DotNetNuke Corporation   Terms Of Use  Privacy Statement
DotNetNuke®, DNN®, and the DotNetNuke logo are trademarks of DotNetNuke Corporation
Hosted by MaximumASP