Display value of Resource without Label or Literal control Display value of Resource without Label or Literal control asp.net asp.net

Display value of Resource without Label or Literal control


Use HttpContext.GetGlobalResourceObject instead:

<asp:Label text='<%= GetGlobalResourceObject("Messages", "ThankYouLabel") %>'      id="label1"      runat="server" />


It's not possible. you have to use atleast Literal, Another option is to use GetGlobalResurceObject, so that you can use directly in a page.

<%= GetGlobalResourceObject("Messages", "ThankYouLabel")%>


In code behind You can Use

`GetLocalResourceObject("YourKeyInLocalResource")` 

and also

`GetGlobalResourceObject("GlobalResourceFileName", "YourResourceKey")` 

and then use a simple aspnet variable in your Asp.net Markup like <%= Resourcevalue %>

The you can assign your resource value to your Aspnet Variable like

Resourcevalue = GetGlobalResourceObject("GlobalResourceFileName", "YourResourceKey").ToString();