Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

read resources on sharepoint site

Posted on 2011-09-06
5
Medium Priority
?
252 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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 2000 total points
ID: 36496995
Yes, that's how it works. Indeed all SharePoint site already has App_GlobalResources folder.
0

Featured Post

Enroll in October's Free Course of the Month

Do you work with and analyze data? Enroll in October's Course of the Month for 7+ hours of SQL training, allowing you to quickly and efficiently store or retrieve data. It's free for Premium Members, Team Accounts, and Qualified Experts!

Question has a verified solution.

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

The vision: A MegaMenu for a SharePoint portal home page The mission: Make it easy to maintain. Allow rich content and sub headers as well as standard links. Factor in frequent changes without involving developers or a lengthy Dev/Test/Prod rel…
In case you ever have to remove a faulty web part from a page , add the following to the end of the page url ?contents=1
In this video, Percona Director of Solution Engineering Jon Tobin discusses the function and features of Percona Server for MongoDB. How Percona can help Percona can help you determine if Percona Server for MongoDB is the right solution for …
Please read the paragraph below before following the instructions in the video — there are important caveats in the paragraph that I did not mention in the video. If your PaperPort 12 or PaperPort 14 is failing to start, or crashing, or hanging, …

604 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