Solved

read resources on sharepoint site

Posted on 2011-09-06
5
229 Views
Last Modified: 2012-05-12
Dear Experts,
I have a sharepoint solution which should install on some web applications on sharepoint farm.
I want my app to read some values , such as an string value depend on my wep app.
For Example :
I deploy my solution to ports 80, 81.
I want my features on port 80 to show 'first string', and on port 81 show 'the second string'
I want them to change based on a file value, like resources or smth.....
0
Comment
Question by:ashkansiroos
  • 3
  • 2
5 Comments
 
LVL 18

Expert Comment

by:ivan_vagunin
Comment Utility
Hi!

You can create a resource file e.g. MyResources.resx and put it in inetpub\wwwroot\wss\VirtualDirectories\[portnumber]\App_GlobalResources. Then you can read values in page markup like following:
<SharePoint:EncodedLiteral ID="EncodedLiteral1" runat="server" text="<%$Resources:MyResources, MyString_Value%>" EncodeMethod='HtmlEncode'/>

It's just like for other asp.net applications: http://msdn.microsoft.com/en-us/library/ms227427.aspx
0
 
LVL 3

Author Comment

by:ashkansiroos
Comment Utility
Dear ivan,
Thanks for reply. I've read some examples of how to work within resources in sharepoint, but non of them worked for me.:(
The problem is: how to store my resource in App_GlobalResources and how can I read from it.:(
can you help me?
0
 
LVL 18

Expert Comment

by:ivan_vagunin
Comment Utility
Sure, I'll try to help you. What do you mean by "read resource"? Read from code? Or paste resource string in page markup of something else?
Storing is very simple just create resource file in Visual Studio (resx file) and copy to App_GlobalResources folder.
0
 
LVL 3

Author Comment

by:ashkansiroos
Comment Utility
Thanks man;)
Anyway, You mean if I create a folder, named as 'App_GlobalResources' WSS will undrestand and upload the file on VirtualDirectories\[portnumber]\App_GlobalResources?
Awesome, I will try it right now...
0
 
LVL 18

Accepted Solution

by:
ivan_vagunin earned 500 total points
Comment Utility
Yes, that's how it works. Indeed all SharePoint site already has App_GlobalResources folder.
0

Featured Post

Comprehensive Backup Solutions for Microsoft

Acronis protects the complete Microsoft technology stack: Windows Server, Windows PC, laptop and Surface data; Microsoft business applications; Microsoft Hyper-V; Azure VMs; Microsoft Windows Server 2016; Microsoft Exchange 2016 and SQL Server 2016.

Join & Write a Comment

Entity Framework is a powerful tool to help you interact with the DataBase but still doesn't help much when we have a Stored Procedure that returns more than one resultset. The solution takes some of out-of-the-box thinking; read on!
I thought I'd write this up for anyone who has a request to create an anonymous whistle-blower-type submission form created using SharePoint 2010 (this would probably work the same for 2013). It's not 100% fool-proof but it's as close as you can get…
This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're looking for how to monitor bandwidth using netflow or packet s…
This video explains how to create simple products associated to Magento configurable product and offers fast way of their generation with Store Manager for Magento tool.

743 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now