Clicky

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.....

asked 09/05/2011 10:24

ashkansiroos's gravatar image

ashkansiroos ♦♦


5 Answers:
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
link

answered

ivan_vagunin's gravatar image

ivan_vagunin

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?
link

answered 2011-09-06 at 23:02:11

ashkansiroos's gravatar image

ashkansiroos

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.
link

answered 2011-09-07 at 03:15:21

ivan_vagunin's gravatar image

ivan_vagunin

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...
link

answered 2011-09-07 at 03:20:12

ashkansiroos's gravatar image

ashkansiroos

Yes, that's how it works. Indeed all SharePoint site already has App_GlobalResources folder.
link

answered 2011-09-07 at 04:16:39

ivan_vagunin's gravatar image

ivan_vagunin

Your answer
[hide preview]

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Tags:

×102
×156
×3
×26
×9

Asked: 09/05/2011 10:24

Seen: 412 times

Last updated: 12/16/2011 07:36