Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. ASP.NET
  4. doesn't exist in the current context.

doesn't exist in the current context.

Scheduled Pinned Locked Moved ASP.NET
design
4 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • F Offline
    F Offline
    FEMDEV
    wrote on last edited by
    #1

    Hi , On my ascx I have following

    In this section...

    ..... now if I try to access these label controls in my codebehind it says Label doesn't exist in the current context. I checked the designer file and I even see it in designer file :- protected global::System.Web.UI.WebControls.Label Label6;

    G A 2 Replies Last reply
    0
    • F FEMDEV

      Hi , On my ascx I have following

      In this section...

      ..... now if I try to access these label controls in my codebehind it says Label doesn't exist in the current context. I checked the designer file and I even see it in designer file :- protected global::System.Web.UI.WebControls.Label Label6;

      G Offline
      G Offline
      Gamzun
      wrote on last edited by
      #2

      Restart your visual studio!

      Please don't forget to mark 'Good Answer', if you find it really a good one! Kashif

      1 Reply Last reply
      0
      • F FEMDEV

        Hi , On my ascx I have following

        In this section...

        ..... now if I try to access these label controls in my codebehind it says Label doesn't exist in the current context. I checked the designer file and I even see it in designer file :- protected global::System.Web.UI.WebControls.Label Label6;

        A Offline
        A Offline
        Abhishek Sur
        wrote on last edited by
        #3

        Where is these Labels ? If it is within the ascx, and you are trying to access it from codebehind of the page where you have added this ascx control, then you would not find the controls directly. You need to expose them using a property and then use that to set it. :cool:

        Abhishek Sur **Don't forget to click "Good Answer" if you like this Solution.


        My Latest Articles-->** Simplify Code Using NDepend
        Basics of Bing Search API using .NET
        Microsoft Bing MAP using Javascript

        F 1 Reply Last reply
        0
        • A Abhishek Sur

          Where is these Labels ? If it is within the ascx, and you are trying to access it from codebehind of the page where you have added this ascx control, then you would not find the controls directly. You need to expose them using a property and then use that to set it. :cool:

          Abhishek Sur **Don't forget to click "Good Answer" if you like this Solution.


          My Latest Articles-->** Simplify Code Using NDepend
          Basics of Bing Search API using .NET
          Microsoft Bing MAP using Javascript

          F Offline
          F Offline
          FEMDEV
          wrote on last edited by
          #4

          Thanks.. I restarted my VS twice, yes twice..:) !! as the first time it still had same problem. and then went home for the day. It's working today when I restarted.. grrrrrrrr.... Many Thanks to all.

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups