How to add resources during runtime



How to add resources during runtime..

Answer / mithun

Call the GetLocalResourceObject or GetGlobalResourceObject method to read specific resources from a global or local resource file

The GetGlobalResourceObject method takes the name of a resource class and the resource ID. The class name is based on the .resx file name. For example, the file WebResources.resx, and all associated localized files, are referenced by the class name WebResources.

The GetLocalResourceObject method takes a resource name representing a ResourceKey property.

Button1.Text = GetLocalResourceObject("Button1.Text").ToString();

Button2.Text = (String)GetGlobalResourceObject(
"WebResourcesGlobal", "Button2.Text");


A local default resource file stored in the special App_LocalResources folder is named according to the ASP.NET page. For example, if the following code is used in a Default.aspx page, the resource file must be named Default.aspx.resx. For this example, add a string resource to this file named Button1.Text with the value "Found Resources".

A global default resource file that is stored in the special App_GlobalResources folder is named WebResourcesGlobal.resx. Add a string resource named LogoUrl with the value "Found Resources".

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More Dot Net WindowsForms Interview Questions

which property is used to lock a textbox to enter data?

10 Answers  


What are the different cloud platforms?

0 Answers  


Name the property which of menu cannot be set at run time?

0 Answers  


Explain about crystal report in brief?

0 Answers  


How do you check whether the row data has been changed?

1 Answers  






Suppose I have two combobox .. And I have some items in both combobox now I need to check the item in both combobox if same item is present in both combobox I need to display that item in message box?

0 Answers  


how barcode print on the win form

0 Answers   Wipro,


Which controls can not be placed in MDI ?

2 Answers  


What is the difference between desktop application and windows application?

0 Answers  


How insert recored in the database

1 Answers   Wipro,


Explain how to add resources during runtime?

0 Answers  


How is anchoring different from docking?

0 Answers  


Categories