Solved

read resources on sharepoint site

Posted on 2011-09-06
5
246 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 500 total points
ID: 36496995
Yes, that's how it works. Indeed all SharePoint site already has App_GlobalResources folder.
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

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!
Performance in games development is paramount: every microsecond counts to be able to do everything in less than 33ms (aiming at 16ms). C# foreach statement is one of the worst performance killers, and here I explain why.
In an interesting question (https://www.experts-exchange.com/questions/29008360/) here at Experts Exchange, a member asked how to split a single image into multiple images. The primary usage for this is to place many photographs on a flatbed scanner…

739 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