Can you explain the fundamentals of “GetGlobalResourceObject” and “GetLocalResourceObject” functions?

Q

Can you explain the fundamentals of “GetGlobalResourceObject” and “GetLocalResourceObject” functions?

✍: Guest

A

These two functions belong to the HttpContext object. Using it you can get the object reference of the resource object. For instance you can see from the below code snippet we have got reference to the Global resource object and we are trying to get the value for

“lblUserIdresource1” key.
lblUserId.Text=HttpContext.GetGlobalResourceObject("Resource",
"lblUserIdResource1").ToString();
Note :- In the same globalization folder there is “LoginScreenUsingGetGlobal.aspx” which
demonstrates how “GetGlobalResource” works.

One short note because “GetGlobalResourceObject” and “GetLocalResourceObject” operate from with in current HttpContext.It uses what the regional settings are sent from the browser end.

2007-11-02, 7262👍, 0💬