1

Suppose I have a meta tag HTML element and that I want to store the content of the tag in a resource file and load the content at runtime, for localization purposes. For now, this is what I do:

<asp:literal runat="server" ID="TheMetaTag" /> //in markup
TheMetaTag.Text = "<meta name=\"description\" content=\"Some Text\">"; // in code behind

As you can see, the resource file contains the entire tag. I want the resource file to contain just the text. I tried this in the markup:

<meta name="description" content="<asp:literal runat="server" ID="TheMetaTag" />">

Of course, this doesn't work. I was wondering how I can store just the text in the resource file and have the content of the tag added at runtime.

1 Answer 1

1

Do this instead:

<meta name="description" content="<%=someVar %>">
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.