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  |  

  Need Help?  
Professional technical support for DotNetNuke is available from DotNetNuke Corporation.
 


  Ads  
The best choice for your web site host, email hosting, and domain registration.
 


  Sponsors  

Meet Our Sponsors

Mad Development is a full service interactive agency focusing on the merge of design, technology, e-commerce, and affiliate marketing by providing total website solutions.
AspDotNetStoreFront - E-Commerce by Design - The Leading ASP.NET shopping cart platform for developers!
Click here to go to dev.live.com for Windows Live developer resources
SteadyRain
DataSprings - Great Ideas. Always Flowing.
R2integrated - formerly bi4ce
 


DotNetNuke Forums
 
  Forum  General DotNetN...  Extend It! ( Pr...  problem in using resources defined in .resx
Previous Previous
 
Next Next
New Post 4/4/2008 1:21 AM
Unresolved
User is offline Snehal Dhamke
27 posts
10th Ranked


problem in using resources defined in .resx 

hello

I am using DNN 4.8.2. My module contains many user controls. I have created *.ascx.resx file for each user control.

I want to use resource for .ascx page  defined in  corresponding .resx file.

suppose my General.ascx.resx file contain following Key value pair

key->lbl_Name,value->Name

&  General.ascx page contains asp Label  & I want assign above resource string to Text property of Label

  I tried following ways but nothing is working,Every thing Failed

          1.        Text='<%= Resources.lbl_Name%>'           //for this it doesnt show any thing

           2.        Text='<%$  Resources.lbl_Name%>'         //for this it throws exception saying that object lbl_Name is not found

          3.         Text='<%= Resources:lbl_Name%>'         //for this it doesnt show any thing

          4.         Text='<%$ Resources:lbl_Name%>'       //for this it throws exception saying that object lbl_Name is not found

          5.       Text='<%$ Resources:General,lbl_Name%>'   //for this it throws exception saying that object lbl_Name is not found

 

Any knows Solution then Please Let me Know

Help Me

-Snehal

 

 
New Post 4/4/2008 9:48 AM
User is offline Brandon Haynes
542 posts
everysport.net
8th Ranked


Re: problem in using resources defined in .resx 

Hi Snehal,

DNN disables most modern asp.net resource functionality and implements this internally.  This is because DNN needed localization before asp.net provided it satisfactorily, and so the core team rolled their own.  It is unfortunate that both methods aren't enabled by default side-by-side.  DNN does the disabling via the web.config:

<buildProviders>

     <remove extension=".resources" />

     <remove extension=".resx" />

</buildProviders> 

Because the extension is removed, Asp.net does not compile your resources.  Thus the errors.

Given this, you have a couple options:

1) Just use the DNN stuff.  Look in DotNetNuke.Services.Localization namespace.  Additionally, PortalModuleBase provides some local lookup methods.

2) Enable Asp.net localization side-by-side with DNN.  I refused to accept that DNN disabled built-in asp.net resource handling for my usercontrols, so I re-enabled it.  This was a moderately difficult task, and I'm not sure I would recommend it to everyone.  Let me know if you're interested in this route, and I will elaborate on the steps required.

Hope this helps!

Brandon


Brandon Haynes
BrandonHaynes.org
 
New Post 4/6/2008 8:54 PM
User is offline Snehal Dhamke
27 posts
10th Ranked


Re: problem in using resources defined in .resx 

Thanks Brandon.

I would like to use the resource file as I am having lots of pages and don't want to hard code any strings in either HTML or code behind file. I am interested in second approach, enabling ASP.NET localization. Though couldn't understand why DNN disabled this feature, as long enabling is not hampering the usual way DNN works, I think there should not be any issue. Please elaborate on how to do this. Again re-citing the requirements here:

1. I would like to create either single resource file for all the pages in my module or separate resource file for each page (<pagename>.ascx.resx)

2. Use these resources in my HTML code for all the controls.

3. Use the resource strings in code behind file and avoid hardcoding of messages.

Awaiting for your immediate response.

Thanks,

Snehal

 
New Post 4/8/2008 8:07 AM
User is offline Brandon Haynes
542 posts
everysport.net
8th Ranked


Re: problem in using resources defined in .resx 

Hi Snehal,

I'm working to document the steps necessary to re-enable the ASP.NET 2.0 localization in a DNN install.  I should have something for you later today.

Brandon


Brandon Haynes
BrandonHaynes.org
 
New Post 4/8/2008 9:25 AM
User is offline Sebastian Leupold
13694 posts
www.deutschnetnuke.de
1st Ranked












Re: problem in using resources defined in .resx 

Snehal,

please read DotNetNuke Module Developement Localization Guide, how to use a sharedResources.resx file for your module.


Sebastian Leupold

DeutschNetNuke dnnWerk - The DotNetNuke Experts German DotNetNuke User-Group

DotNetNuke Project UserDefinedTable
DotNetNuke Project Release Tracker
 
Previous Previous
 
Next Next
  Forum  General DotNetN...  Extend It! ( Pr...  problem in using resources defined in .resx
 


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.

 


SteadyRain
Founded in 1999, SteadyRain has extensive experience delivering Internet technology strategies and solutions for a diverse client base, ranging from Fortune 500 firms to successful start-ups.
www.steadyrain.com
AfterImage Internet Consulting and SEO Services
AfterImage provides search engine optimization (SEO), Internet consulting and hosting services for the Windows platform (IIS, ASP, SQL Server).
www.afterimage.nl/
Willhite & Sharron Realtors
Exemplary service for your Seattle Real Estate needs. It's what you deserve from your Realtor®!
www.alkihomes.com

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