-1

is it possible to do globally string replacements on strings like {myName1} in asp.net webforms?

I want to automatically replace given strings when the page loads. {myName1) can be found multiple in the text in default.aspx oder about-us.aspx etc.

cysus
  • 143
  • 1
  • 12
  • Sure, it's possible. Now if your next question is "how" then that's too broad of a question, but it should be pretty easy for you to come up with ideas on how to do it. – mason Jul 11 '16 at 15:33

1 Answers1

0

You can use an ASP.NET Webforms evaluate tag in your aspx page. See this page: <%$, <%@, <%=, <%# ... what's the deal?

For example, you could use

<%= MyName1 %>

and then define the value of myName1 as a string Property your codebehind class.

Community
  • 1
  • 1
Robert Columbia
  • 6,313
  • 15
  • 32
  • 40
  • Thanks, like in old classic asp days: <%= ConfigurationManager.AppSettings("myName1") %> – cysus Jul 12 '16 at 08:53