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