Click here to Skip to main content
13,355,018 members (60,991 online)
Rate this:
Please Sign up or sign in to vote.
See more:
please help me out..

The label has id in the UI.. but in code behind if i use the id of is showing error saying lblmessage doesn't exist in the current context..
<asp:Label runat="server" ID="lblMessage" Text="" class="multi">

if i use the above id in code behind am getting error
lblMessage.Text += fileName + "Uploaded";
Posted 24-Jan-13 19:02pm
Nothing exist until you create it. The question makes no sense at all. What help do you expect? That someone find some declaration in your own files?
Azziet 25-Jan-13 0:27am
check your files properly...aspx...And cs both should inherited same class...although question is not clear
sisir patro 25-Jan-13 1:10am
Can you plz check your page is saved or not and rebuild the page and check in the code behind for the lblMessage.
Tadit Dash 25-Jan-13 1:35am
Please build your project properly. Or else delete that label and recreate it once more and build again.
sarathkumarnallathambi 25-Jan-13 3:12am
hi ,

Have u copied from the control from some other page.. Or else Version change (2010 to 2008) or website to application???

So ,tel me if u did anything from these???
Rate this: bad
Please Sign up or sign in to vote.

Solution 1

Probably, you are missing the closing tag: Have you deleted the slash from the end?
<asp:Label runat="server" ID="lblMessage" Text="" class="multi">
<asp:Label runat="server" ID="lblMessage" Text="" class="multi"/>
Rate this: bad
Please Sign up or sign in to vote.

Solution 4

if you are not missing the closing tag check if label has same id as you are trying to use in .cs file.
otherwise delete this add a new label give it a different name '' and build the solution and after that use it in .cs file
Rate this: bad
Please Sign up or sign in to vote.

Solution 5

build your website once then use label in code behind. sometimes it works.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy |
Web01 | 2.8.180111.1 | Last Updated 28 Jan 2013
Copyright © CodeProject, 1999-2018
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100