Access global resources in an asp.net control

后端 未结 3 1489
渐次进展
渐次进展 2021-02-18 23:37
meta:resourcekey=\"WizardStep1Resource1\"

This is what I use to access a App_LocalResources.

How do I access a resource in A

3条回答
  •  死守一世寂寞
    2021-02-19 00:13

    There are 2 ways to access a Global resources from C# code and from javascript functions. Below you can see both ways.

    Imagine that you created a Global resource named WholeSite, inside you have a row named UnexpectedError.

    txTitle is TextBox field.

    C# Code:

    txtTitle.Text = Resources.WholeSite.UnexpectedError; 
    

    Javascript/.aspx:

    alert("<%= Resources.WholeSite.UnexpectedError %>");
    

提交回复
热议问题