Quantcast
Channel: How to Solve This Error 'myLabel' does not exist in the current context
Viewing all articles
Browse latest Browse all 5

Re: How to Solve This Error 'myLabel' does not exist in the current context

$
0
0

I just tried your code in a web form and it works correctly.

myLabel.Text = "hi";

check the below things

<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="WebForm1.aspx.cs" Inherits="WebApplication1.WebForm1" %>

the inherits and code behind attribute correctly given based on your code behind file. if its correct, that means you just needs to change the aspx to design view in visual studio. This ensures the designer.cs file is updated correctly and the compilation will pass correctly.

Hope this helps


Viewing all articles
Browse latest Browse all 5

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>