Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8046035
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T05:41:43+00:00 2026-06-05T05:41:43+00:00

I started experimenting with C# and HTML5 today. I thought this question would be

  • 0

I started experimenting with C# and HTML5 today. I thought this question would be easy to find an answer to, but I couldn’t find it on Google or here. I created a MVC4 default template.
I have an ascx file, which is my form view. It’s currently like this

<hgroup class="title">
<h1>Log in.</h1>
<h2>Enter username and password</h2>

But instead of a hardcoded “Log in.” I want to put a localization String there from another class called HomeController.cs

So I thought I’d do it like this. (Which I’m used to doing because so far I only know Java)

<hgroup class="title">
<h1><script>HomeController.strings.voerIn</script></h1>
<h2>Enter username and password</h2>
</hgroup>

However, that just shows the variable name as text instead of the variable value.
I tried wrapping those variables in script> or code> but that doesn’t seem to help.

EDIT: ANSWER

Okay, so i finally got it to work.
I had to instantiate HomeController, and instead of <% %> displaying the string I had to use <%= %>

so this is what my code looks like now, and it works!!

<% MvcApplication2.Controllers.HomeController hc=new MvcApplication2.Controllers.HomeController();%>
  <h2><%=hc.aha%></h2>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-05T05:41:45+00:00Added an answer on June 5, 2026 at 5:41 am

    To put code in your page, you must use <% %>.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm keen to get started experimenting with gzip, but like i used to find
Today I have been experimenting with SQL binary objects. I started by storing an
Today I started experimenting with PHP-based PDF generators. I tried TCPDF and it works
I started experimenting with SVG and I'm not sure if this is something I'm
I recently started experimenting with CakePHP. I used this query in normal PHP and
I've just started experimenting with SDL in C++, and I thought checking for memory
I just started experimenting with java today (have experience with javascript and PHP) and
Greetings! Started experimenting with sIFR3 today and am in love! So great! For the
I think this is an extremely stupid and newbie question, but then I am
So started recently experimenting with the Android SDK and eclipse IDE and during this

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.