Solved

read resources on sharepoint site

Posted on 2011-09-06
5
238 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
ID: 36493661
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
ID: 36494542
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
ID: 36494554
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
ID: 36494757
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
ID: 36496995
Yes, that's how it works. Indeed all SharePoint site already has App_GlobalResources folder.
0

Featured Post

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

SharePoint Designer 2010 has tools and commands to do everything that can be done with web parts in the browser, and then some – except uploading a web part straight into a page that is edited in SPD. So, can it be done? Scenario For a recent pr…
This article aims to explain the working of CircularLogArchiver. This tool was designed to solve the buildup of log file in cases where systems do not support circular logging or where circular logging is not enabled
This tutorial gives a high-level tour of the interface of Marketo (a marketing automation tool to help businesses track and engage prospective customers and drive them to purchase). You will see the main areas including Marketing Activities, Design …
Email security requires an ever evolving service that stays up to date with counter-evolving threats. The Email Laundry perform Research and Development to ensure their email security service evolves faster than cyber criminals. We apply our Threat…

770 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