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 8175333
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T22:44:39+00:00 2026-06-06T22:44:39+00:00

Yesterday I began to write C# in order to develop usercontrols for Umbraco and

  • 0

Yesterday I began to write C# in order to develop usercontrols for Umbraco and I ran across a well-known problem where I get the error “The * name does not exist in the current context.” I found inumerous answers to that particular problem, as:

Fixing "name does not exist in the current context" errors in Web Developer Express

Label doesnt exist in the current context

http://forums.asp.net/t/1006588.aspx/1?The+name+xxx+Does+Not+Exist+in+the+Current+Context

…and so on and so forth.

None of these questions, however, did help me solve my problem and I’m still banging my head against a wall.

I then discovered that my tags and their controls get discovered by my *.apsx.cs file, as long as I don’t put them within any non-asp:-tag!

I’m trying to make a custom login control with a custom template, for that I need the -tag. Furthermore I put this within a inside an LoginView control.

<asp:LoginView ID="MemberValidation" runat="server"> 
   <AnonymousTemplate>
     <asp:Login ID="MemberLogin" runat="server" OnLoggedIn="MemberLogin_OnLoggedIn">
        <LayoutTemplate>
           <asp:Literal ID="InformationMessage" runat="server"></asp:Literal>
        </LayoutTemplate>
   </AnonymousTemplate>
   <LoggedInTemplate>...</LoggedInTemplate>
</asp:LoginView>

My LiteralControl (and all the other LiteralControls I have – this is just a tiny example) is not registrered within the *.aspx.design.cs file automatically, hence, it is not accessible in my *.aspx.cs file, however if I remove the tag and the tag, my LiteralControl pops up.

However, I need the two tags to make the code function as I wish, so my question remains unsolved: What can I do? Is it a bug?

Thanks in advance,
Brinck10

  • 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-06T22:44:44+00:00Added an answer on June 6, 2026 at 10:44 pm

    If I’m understanding your problem correctly, the Literal control cannot be accessed directly by the .cs as long as it placed within the AnonymousTemplate or LayoutTemplate tags.

    If that’s correct, that’s because anything within these tags are (as you’ve guessed it) templates and do not represent an actual runtime instance, and the compiler cannot guarantee that these templates will be shown (e.g. User is logged in, so the LoggedInTemplate is shown instead), and therefore does not expose these controls automatically to the .cs.

    In fact, the only thing that’s instantly visible to the .cs will be the LoginView control. So to access your controls within the templates, you will have to “find” them at runtime with code similar to the following:

    if (!User.Identity.IsAuthenticated)
    {
        Login memberLogin = (Login)this.MemberValidation.FindControl("MemberLogin");
        Literal informationMessage = (Literal)memberLogin.FindControl("InformationMessage");
        informationMessage.Text = "Hello World";
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Yesterday I tried to install a Haskell-module via cabal, in order to get aquainted
I want to get over a nasty problem that shows up yesterday during a
Yesterday, I began encountering '999' errors on Yahoo-Pipes. It looks like they throttle requests
We've been using VSS 6.0 since time began, but yesterday I nabbed VSS2005 off
Searching since yesterday, but I only get adance method. I use spring with tomcat
I began to use MVVM pattern yesterday.But for working with events i needed to
So at work yesterday, I had to write an application to count the pages
Yesterday, when I had an error or warning a little icon would appear next
From yesterday (the first day of US day light saving adjustment had began.) the
My program has run a long time. I began to run it yesterday. Now

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.