Greeting,
I'm attempting to write customize expression-builder . As to
replace\enhance the build-in Resources exp-builder.
It work in a way. However, somehow the resources I retrieved using
GetGlobalResourceObject() always getting me the default culture.
I hardcoded the culture setting at session_onstart, to test Chinese
text. They all worked fine with the built-in Resources.
However, if I switch to my own stuff, always return the default (eng)
text.
when using my own custom stuff, only need the resource-item-key, at
initial testing stage.
<%$ ResourceEx: SomeText %>
my coding of the exp-builder:
public override CodeExpression GetCodeExpression(
BoundPropertyEntry entry
, object parsedData
, ExpressionBuilderContext context
)
{
StringBuilder objStr = new StringBuilder();
objStr.Append( HttpContext.GetGlobalResourceObject("Text",
entry.Expression.Trim()).ToString() );
return new CodePrimitiveExpression(objStr.ToString());
}